Driving a tri colour LED

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Driving a tri colour LED

Post by FFMan »

I'm making a Nixie clock and temp/date display. As i don't have room for a leading minus sign for the temp display, i was thinking of having a tri-colour led that went from red (30c) to blue (0c) depending on outside temp.

I guess i can achieve this using 3 (RGB) pwm pins but it feels quite resource intensive and can this be done on zx40 which needs 2 s/w uarts already ?

Is there a better way ?
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Driving a tri colour LED

Post by dkinzer »

FFMan wrote:Is there a better way ?
Which tri-color LED are you thinking of using? If you choose a common anode type you could have several different 3-resistor combinations that could each be connected to an output pin which, when set low, would create a pre-determined color.

It may be tricky to select the resistor values due to the effective network resistance - diodes in series with the resistors would isolate them.
Attachments
RGB_LED.jpg
RGB_LED.jpg (40.16 KiB) Viewed 2918 times
- Don Kinzer
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Post by FFMan »

that's an interesting idea - might have a play with that.

I've seen around, but not yet in the right package some I2C or SPI controlled led driver chips that do the pwm which is another option.

thanks - current battle is to learn KiCad to design the board
kurakaira
Posts: 77
Joined: 21 March 2007, 1:21 AM
Location: Finland

Post by kurakaira »

I recommend the APA102 RGB led in a 5050 package , it has a clock and a data line , so it does not need specific timing , You can chain as many as You need and its bright .
Post Reply