1
0
mirror of https://github.com/xtacocorex/CHIP_IO synced 2025-07-20 12:53:22 +00:00

Makes default polarity 1

This commit is contained in:
Brady L. Hurlburt
2016-05-06 15:14:14 +00:00
parent 2f3172568a
commit 9ef55ede59

View File

@ -50,17 +50,15 @@ static PyObject *py_start_channel(PyObject *self, PyObject *args, PyObject *kwar
char *channel; char *channel;
float frequency = 2000.0; float frequency = 2000.0;
float duty_cycle = 0.0; float duty_cycle = 0.0;
int polarity = 0; int polarity = 1;
static char *kwlist[] = {"channel", "duty_cycle", "frequency", "polarity", NULL}; static char *kwlist[] = {"channel", "duty_cycle", "frequency", "polarity", NULL};
printf("Made it to CHIPIO softpwm start");
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|ffi", kwlist, &channel, &duty_cycle, &frequency, &polarity)) { if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|ffi", kwlist, &channel, &duty_cycle, &frequency, &polarity)) {
return NULL; return NULL;
} }
if (!get_key(channel, key)) { if (!get_key(channel, key)) {
PyErr_SetString(PyExc_ValueError, "Invalid PWM key or name."); PyErr_SetString(PyExc_ValueError, "Invalid SOFTPWM key or name.");
return NULL; return NULL;
} }