Closed ralphhughes closed 5 years ago
dutyCycle must be an unsigned 32-bit integer. When calling pwmWrite be sure to pass an unsigned 32-bit integer rather than a number. A number can be converted to an unsigned 32-bit integer with the right-shift operator. Use something like this:
gpio.pwmWrite(dutyCycle >> 0);
That appears to have fixed it so far, many thanks for your accurate and timely response.
That's good news. Thanks for the feedback.
I'm trying to write a motor controller for a servomotor with optical encoder and I'm getting this error sporadically. I can't pin down what's causing it as I can't reproduce it every time. Any idea where I should start to look?