Library for interfacing with the NXP PCA9685 PWM controller over an I2C connection. Designed with the Adafruit breakout board (of the same name) in mind.
Diff: PCA9685.cpp
- Revision:
- 1:9d6633a308ba
- Parent:
- 0:aa965d6b1f8f
- Child:
- 2:8017239aa374
diff -r aa965d6b1f8f -r 9d6633a308ba PCA9685.cpp --- a/PCA9685.cpp Tue Apr 05 21:20:15 2016 +0000 +++ b/PCA9685.cpp Wed Apr 06 21:20:14 2016 +0000 @@ -12,7 +12,7 @@ reset(); - uint8_t prescale = (uint8_t) (OSC_CLOCK / (4096 * freq)) - 1; + uint8_t prescale = (uint8_t) (OSC_CLOCK / (4096 * PWM_SCALER * freq)) - 1; write_8(MODE1, 0x21); //0010 0001 : AI ENABLED write_8(MODE2, 0x07); //0000 0111 : NOT INVRT, CHANGE ON STOP, TOTEM POLE, \OE = 1, LEDn = HIGH IMP