PWM and RGB question

Status
Not open for further replies.

Geezer

Member
Can anybody think of a reason why we couldn't PWM the common pin on an RGB diode and feed the colors through digital-only pins, such as 7, 8, 11, 2, ... to get more functionality out of the Teensy 3.2 pinout? Also, is there an addressable latch chip where a PWM duty cycle can be latched for multiple outputs to run at differing duty cycles simultaneously?
 
Can anybody think of a reason why we couldn't PWM the common pin on an RGB diode and feed the colors through digital-only pins, such as 7, 8, 11, 2, ... to get more functionality out of the Teensy 3.2 pinout?

Well...this would work inasmuch as you'd be able to get different shades of the basic colors (red, yellow, green, cyan, blue, violet, white) but if you wanted some other shade (e.g. pink or orange) you'd have to set up timers to twiddle the pins quickly, and if you're going to go through that much code complexity it seems like it would be less work to just implement full software PWM.

Also, is there an addressable latch chip where a PWM duty cycle can be latched for multiple outputs to run at differing duty cycles simultaneously?

Not that I'm aware of, but I'm not exactly sure what your goal is. Are you just looking for more PWM pins than the Teensy can do? If so then there's the TLC5940 (https://www.pjrc.com/teensy/td_libs_Tlc5940.html) or you can use plain old 595 shift registers with the ShiftPWM library (http://www.elcojacobs.com/using-shiftpwm-to-control-rgb-leds-with-arduino/).
 
Status
Not open for further replies.
Back
Top