ArduinoLight: First prototype
To follow on from my last post, I’ve now stuck the LEDs and Arduino together in some sort of working fashion and have now started to play around programming it. Some of my results are below.
At the moment I’ve just cut out some cardboard to fit behind my monitor and taped the LEDs and Arduino to that. It’s a bit rough and ready but it serves it’s purpose.
At first I tried just sending some RGB commands down the USB using my own C++ code and then sending these along to the LEDs using LadyAda’s Arduino library to see what I could get out of the lights. This first attempt was just spamming the USB as fast as I could which resulted in some slightly odd, juddery colours appearing on the lights. It quickly became apparent that I needed some synchronisation between the PC and the Arduino and that I should probably up the baud rate of the connection.
Version 2 has the faster IO speed and now sends 25 RGB values and then waits for an acknowledgment signal from the Arduino. Now that it was communicating stably and at an acceptable speed I began my investigation into screen capture…
The video above shows my PC playing a clip from youtube of some colours swirling around which I’m capturing using DirectX9 and then mapping the colour values from on screen regions to each of the LEDs.
Because the capture is being done in hardware the load is reduced and spread quite nicely over the CPU and GPU meaning that it doesn’t really stress out your system (I found that the Processing project from the original AdaLight was straining my CPU at about 100%, my version is currently hitting about 10%).
You can probably see that the colours look a little jumpy and stutter when changing between the solid regions. This is because I’m currently displaying RGB values on the LEDs as soon as I receive them on the Arduino. The next step in this process is to implement some fades on the Arduino to smooth out these colour transitions. (any slightly odd colours you see are probably because my camera isn’t quite up to the task of recording this!)
Stay tuned for more!