RGB Led's #56

Closed
cooltrooper opened this Issue Aug 14, 2012 · 12 comments

Comments

Projects
None yet
6 participants

Enhancement.

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

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

led.set(valr,valg,valb);

or

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

Contributor

Jellyfrog commented Aug 14, 2012

+1 for RGB-led

Owner

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 :)

Contributor

rmurphey commented Aug 14, 2012

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

Owner

rwaldron commented Aug 14, 2012

@rmurphey it's all yours :)

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

Contributor

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?

Contributor

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.

Owner

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.

Contributor

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.

Collaborator

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

Owner

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