Contd - RGB LEDs and Adafruit 16-Channel 12-bit PWM/Servo Dr
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88097
- Joined: Sat Feb 07, 2009 10:11 am
Re: Contd - RGB LEDs and Adafruit 16-Channel 12-bit PWM/Serv
You should not need any extra resistors since you can control brightness of the LEDs via PWM.
- pobo123
- Posts: 21
- Joined: Sun Apr 24, 2022 1:32 pm
Re: Contd - RGB LEDs and Adafruit 16-Channel 12-bit PWM/Serv
Even using the V+ pin with the PWM and not the Ground pin? Also, my three LEDs (as I explained in an earlier post) have a common anode. Does this make any difference please - can I still get away without extra resistors?
- pobo123
- Posts: 21
- Joined: Sun Apr 24, 2022 1:32 pm
Re: Contd - RGB LEDs and Adafruit 16-Channel 12-bit PWM/Serv
The reason I ask my last question is because I seem to be getting conflicting answers on this forum but it could be due to not explaining the setup clearly.
- adafruit_support_bill
- Posts: 88097
- Joined: Sat Feb 07, 2009 10:11 am
Re: Contd - RGB LEDs and Adafruit 16-Channel 12-bit PWM/Serv
The PCA9685 is not designed for driving common anode LEDs.Also, my three LEDs (as I explained in an earlier post) have a common anode.
- pobo123
- Posts: 21
- Joined: Sun Apr 24, 2022 1:32 pm
Re: Contd - RGB LEDs and Adafruit 16-Channel 12-bit PWM/Serv
Ok. So what do I do to get around that? I am sure it is still possible.
- pobo123
- Posts: 21
- Joined: Sun Apr 24, 2022 1:32 pm
Re: Contd - RGB LEDs and Adafruit 16-Channel 12-bit PWM/Serv
And without burning out my LEDs
- adafruit_support_bill
- Posts: 88097
- Joined: Sat Feb 07, 2009 10:11 am
Re: Contd - RGB LEDs and Adafruit 16-Channel 12-bit PWM/Serv
To drive a common anode LED you could connect the anode to 5v and each of the cathodes to the PWM output pin. No additional resistors should be necessary.
In your code, you will need to reverse all the logic: At 100% duty cycle, the LEDs will be off (or at least very dim). If you decrease the duty cycle, it will make them brighter.
In your code, you will need to reverse all the logic: At 100% duty cycle, the LEDs will be off (or at least very dim). If you decrease the duty cycle, it will make them brighter.
- pobo123
- Posts: 21
- Joined: Sun Apr 24, 2022 1:32 pm
Re: Contd - RGB LEDs and Adafruit 16-Channel 12-bit PWM/Serv
Thank you. I will try / go with that :-)
Please be positive and constructive with your questions and comments.