- Arduino Duemilanove with Ethernet shield and DMX shield;
- DMX decoder PX24500;
- 24V PSU;
- 6 x Artecta RGB LED;
- some wires;
- a sketch running on the Arduino;
- UTP cable;
- software tools.
After connecting all the wires, switching on the PSU, starting the Arduino and checking if the Arduino was succesfully connected to my LAN by pinging it, I was ready. I opened the Arduino IDE Serial Monitor so I could see what my sketch was doing and sent a “command” to the Arduino. For that I used wget, a non-interactive network retriever; most people who know Unix-like OS-es will probably know about its existence but it’s less known among the Windows folks. Well, in just a few words it’s a tool with which you can store the results of a HTTP call into a file and do all kinds of other handy stuff .
I started carefully; the first command sent to the Arduino was:
What this should do is change the R-value from its current value to 10 in 0.5 (5*0.1) seconds. G and B values are set to 0 immediately.
What the Arduino webserver will receive is the following:
GET /10,0,0,5,0,0 HTTP 1.1
....etc, the rest is all standard HTTP headers
After parsing the request and figuring out what to do, the Arduino starts changing the LED colour by issuing DmxSimple commands according to the values received in the HTTP call.
Ok, the moment of truth is here… will the LEDs start producing light or not? Yeah, they did! Tadaa…
The moment I saw this working, I felt the need for a more sophisticated way to control the RGB values, so I wrote a small tool in Delphi to help me pick the right color:
With a mouse click I can now select the color; the rest is done automatically: calculating the R-, G- and B-value and performing the HTTP call. And all it took was 10 lines of code (with the help of Indy and a very nice Color Lib made by Marco Binic). This allows me to choose a color much quicker and more precise than by editing numeric values on a command line 😉
I did find some issues during my first DMX adventure, so I haven’t reached the phase yet where I can start digging holes in the ground; I’m not totally satisfied yet – more on those issues later, when I’ve hopefully fixed them.