RGB Led's #56

cooltrooper opened this Issue Aug 14, 2012 · 12 comments


None yet
6 participants


Define an rgb led as a single led e.g.:

new led = rgbLed(12,13,14); Pins for (r,g,b)



led.color(val) where val is a hex code or other colour definition


Jellyfrog commented Aug 14, 2012

+1 for RGB-led


rwaldron commented Aug 14, 2012

+1 as well

I believe I had started working on something like this, but then deferred on it. Seems worthwhile to reboot :)


rmurphey commented Aug 14, 2012

Happy to take a stab at this unless you want to @rwldrn .


rwaldron commented Aug 14, 2012

@rmurphey it's all yours :)

Could this include support for common anode and common cathode leds.


rmurphey commented Sep 9, 2012

I don't think it would be hard to provide support for both. However, as you may have noticed, I haven't actually worked on this yet. @cooltrooper if you want to take a stab at it, please do!

I dont really understand how to write modules yet to help, but if you have any reading you think I should do, I'll give it a read and help if I can?


haugstrup commented Sep 11, 2012

The most annoying thing is that many RGB leds are common-anode so when you wire them up HIGH is off and LOW is on. Makes it harder to work with the Led constructor since all commands have to be reversed.


rwaldron commented Sep 11, 2012

@haugstrup have you been experiencing this with five.Led()? I always just use .on() and .off()... but I suspect I'm using common-anode Leds since I've never actually experienced the problem myself.


rmurphey commented Sep 11, 2012

@cooltrooper your best bet is to take a look at an existing module and start from there -- that's how I wrote my first one :) I'd be happy to take a look at a draft or answer any particular questions you might have.


paultag commented Sep 11, 2012

Do keep in mind LOW isn't ground, so the real way is to get a transistor to ground out the pin, which will let you use logical high. Dimming might become an issue for slow transistors though


rwaldron commented Aug 7, 2013

rwaldron closed this Aug 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment