Help using PCA9685 to control LEDs

I am using the PCA9685 to control 6 RGB leds, i have 5 of them connected to the PCA9685 and one connected directly to the arduino pwm pins, my problem is how do i use the setPWM(channel, on, off) command in the library of that chip as it looks nothing like the AnalogWrite command, the setPWM has 2 values one for off and one for on and they range between 0 and 4096 while the arduino pwm pins range between 0 and 255 and they only take in one value per pin not 2.

How do i make them equivalent using variables in the code?
Thanks.

which library are you using? The one in the library reference just specifies the duty cycle, not on and off time.

Either way, this chip deals with 0-4096 which is just your analogWrite() value [0--255] times 4.

Post a link to that LED connected directly to the controller I/O. It might be a bad idea.

I’m using the library by adafruit

I have a bunch of resistors between the chip and the leds

You give no useful information, no code, no wiring so I give You no help.

I agree and no links to the parts!

Are these LEDs common <=20mA indicator LEDs ?

Why did you choose the PCA9685.
Wouldn't it be easier to use addressable LEDs.

Please tell us more about your project.
Leo..

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.