You can clone with
No one assigned
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
+1 for RGB-led
+1 as well
I believe I had started working on something like this, but then deferred on it. Seems worthwhile to reboot :)
Happy to take a stab at this unless you want to @rwldrn .
@rmurphey it's all yours :)
Could this include support for common anode and common cathode leds.
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?
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.
@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.
@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.
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