I want to use this pwm driver
with this library
http://iotdk.intel.com/docs/master/upm/classupm_1_1_p_c_a9685.html upm: PCA9685 Class Reference
to control four ESC's/brushless motors, but I am having trouble getting it to work. I am using ESC's with battery eliminating circuits, so the wire that would be power input for a regular servo is actually a +5v source.
// Instantiate an PCA9685 on I2C bus 0
upm::PCA9685 *pwm = new upm::PCA9685(1,0x40);
// put device to sleep
// setup a period of 50Hz
// wake device up
if(!pwm->ledOnTime(0, 0)) printf("err2");
if(!pwm->ledOffTime(0, 2048)) printf("err3");
When I run theses functions they all return successful but I get no output on the driver: the pwm pin on channel 0 is at zero volts, when it should be around 2.5 volts (5*(2048/4096)). Would it be possible that the driver is broken, but the read/write functions to the registers still work?
I would greatly appreciate any help from anyone who has experience with this library.
Right now we don't have the PWM driver (PCA9685), so we are not available to do some tests to help you. But personally, I would recommend you to try this example that I found in the UPM repository: https://github.com/intel-iot-devkit/upm/blob/922e0cc26b2eb49dbf4454f05e1912c27ea9fc3b/examples/c%2B%...
Try to run the example to see if you get the same results, if you doesn't, try to contact the author of the driver to see if he can help you more.
I hope you find this information helpful.
Something odd is going on.. I run the example and it works.. I run it again and it doesn't work... then I run it again and it does work etc. It only works every other time, which seems to me like something important is being switched or negated once every run, though I can't figure out what.
The example seems to be doing something very particular, because anything else I try that is not the example, the functions simply do not work.
Would really appreciate if someone else knows what in the world could be happening.
It is a weird problem, and there is not much that I can do to help you because I don't have the driver.
Like a told you, the best suggestion that I can give you is to try to contact the author of the example, maybe he has information that can be helpful for you.
I'm very sorry, I hope that someone else helps you.