How do i run a PCA9685 shield in open drain mode for running LEDs?Since I want to run 16 LEDs at up to 20 mA, max drain would be 320 mA, which is rather close to the absolute maximum 400 mA of the Arduino. In addition, each PWM output from the chip can only source 10 mA.The Adafruit library seems to be current-source mode only, and I can't tell what the NachtRaveVL library or the brunnel library does, mode-wise.So the question is: How do I set up the chip to be a current sink instead of source?Bonus question: Ideally I want to fade LEDs individually and independently, in a non-blocking manner. Is this possible?
Possible to code the PCA for that, but why. Arduino pins can drive LEDs (source and sink), and those pins are not open drain.
20mA is the absolute max for common 3mm/5mm LEDs. You won't have to go near that.5-10mA is already very bright for modern LEDs.Note that that PCA board has 220ohm CL resistors.That might limit current for a red LED to ~12mA and a high brightness LED to ~8mA.Where did you get that 400mA from.What you can draw from the 5volt pin depends on where the Arduino gets it's power from.400mA is not a problem for e.g. an Uno on USB supply. e.g. a 5volt phone charger connected to the USB socket.And sink 25mA. LEDs won't have to go between pin and ground. They also can go between pin and VCC.Again, no open drain needed for that.
I use the Brunnels PCA9685 library with CC LED drivers. Never used the chip to drive bare LEDs.Sink/source is just flipping PWM values in code. 0-4095 can be 0-100% or 4095-0 can be 0-100%.Yes. just write a new PWM value to the corresponding PCA9685 pin (or a range of pins).Then the Arduino is not needed anymore, until you want to change a PWM value.Leo..
As far as I can tell this shield primarily meant to drive servos,
So if I connect the LED between V+/VCC and PWM it will just work
and I don't have to fiddle with setting modes, INVRT bits etc?