Now that the hardware is ready, let’s move on to the software. First task is to figure out all the pin assignments with a little “rgbTest.pde” sketch:
Yep, it works. Here’s AIO4 in action:
On to the real thing. I’m going to re-use the code from this post, but with a couple of modifications:
- since that code apparently still flimmers a bit, I’m going to make it run faster by reducing the number of steps from 256 to 101, i.e. intensity values 0..100 – that should increase the refresh rate to about 300 Hz
- the fourth value will be re-used as a general intensity control, so “RGBW” now means: take each individual RGB intensity times the W intensity
- the main logic will remain the same, even for the “White” dimmer – this is harmless, since there is nothing connected to port 3
- need to re-define the pin assignments to match the above, twice
Ok, the new sketch is here – it’s a bit long to include in this post. Now I can send messages via a JeeLink to control this thing:
- full on: 100,100,100,100,100,100,100,100,30s
- full off: 100,100,100,0,100,100,100,0,30s
And here’s a very first / rough attempt to create a decent white tint:
Here’s my (messy!) workbench with four different light sources:
- top right – a warm white incandescent lamp, seems to use a 12V headlight
- middle back, under the shelf: commercial sort-of-warm-white LED lamp
- middle center, magnifying glass: fluorescent cool white tube
- left front, paper sheet: my RGB test setup, indirect lighting
When looking straight at the LEDs (always a bit painful), you can clearly see the different colors. The color offsets produce a slight fringe in the shadows cast from this light:
This won’t be good enough for photographers, but my impression is that it might work out fine when used as indirect lighting.
The results did surprise me quite a bit: for this tint, you have to turn on as much red as possible, add some some green, and drop almost all the blue.
The unfortunate part is that the red LEDs are responsible for most of the energy loss via their series resistors. Sigh. I wish they’d make RGB strips with all resistors the same small value – I could easily adjust the actual intensity with PWM and stay below the maximum specs.
Some estimates gleaned from the lab power supply w.r.t. current draw for the 50 cm 60-LED strip + JeeNode:
- all off: 10 mA
- full on: 620 mA
- warm white: 270 mA
That last one translates to 6.72 Watt/meter (with some 2W eaten up by the red-side resistors, yikes). I don’t think I’d want to go any lower than that as full-on lighting setting, so if Jee Labs is to get more of these RGB strips around the house, I’ll definitely want to use the 60 LED/meter strips.