From the File menu, select Sketchbook, which should “roll over” to show Adalight and Colorswirl. Select the latter first: Colorswirl.
Click the Run button near the top-left of the window:
If this is not what happens, then you’ll need to edit some code. Around line 26, look for this statement:
myPort = new Serial(this, Serial.list(), 115200);
We need to change how the code opens the serial connection to the Arduino. One route is just through trial and error: try Serial.list(), then Serial.list(), and so forth, re-starting the program each time to see if it works. For a more scientific approach, add one new line of code before running the sketch:
When run, this displays a list of all serial ports or devices. If you know which device or COM port corresponds to the Arduino, you can then change the original line to include this data. For example, it might now read:
myPort = new Serial(this, "COM6", 115200);
This will be different on every system, so we can’t just tell you what to put there.
Another way to locate the port name: in the Arduino IDE, this is the port you selected in the Tools→Serial Port menu before programming the chip.
Once you have Colorswirl working, make note of the change (if any), because the same change will need to be made in the Adalight code.
From the File menu, select Sketchbook, then Adalight. If you changed the Colorswirl sketch to find the serial port, make that same change to the Adalight code. Now click the Run button.
Though they’re in a jumbled mess on your desk right now, the LEDs should light up in colors resembling the perimeter of your screen. Move some windows around the edge — you should see the LEDs react to this.
As it runs, the software performs a continual series of screen captures, averaging the pixels in blocks around the perimeter of the screen and issuing the resulting color data to the LEDs. You can hide the preview window and let the sketch continue working in the background. Being capture-based, it’s not tied to any one specific media player, and most anything you can put on your display — MPEG movies, YouTube, games and so forth — can benefit from the effect. It seems to work especially well with the outer space sequences in Cosmos…a bit ironic in that Carl Sagan’s “Spaceship of the Imagination” from this series featured a giant flat screen and mood lighting decades before Philips turned it into a commercial product!
If you plan to arrange the LEDs similarly to our examples — 25 pixels in a ring, 1 pixel gap at the bottom, with the first pixel starting just left of the gap — then nothing more needs to be changed in the software. If using a different layout, you’ll need to make adjustments in the code. You'll find extensive notes in the source code for making this (and other) changes.
Once all the hardware and software is working, it’s time to get crafty and mount the LEDs on the telly…