Christmas Lights

We control our Christmas lights with scripts that take parameters from a web application. The scripts talk Txtzyme to a Teensy microcontroller that replaces the stock controller that came with the GE G35 LED lamps.

Uploaded image

Pat Cunningham created the php application that captures the preferences of neighbors and guests. php

Ward Cunningham creates lots of perl scripts that drive the lights. These are distributed as one of many sample Txtzyme projects. github

How It Works

The color picker is the interesting case. When it starts, it reads the current color from the server and sets up the color wheel. Then, as you move the wheel, things happen.

The color wheel shifts new colors in to the string of lights as one drags a finger on the cell phone app.

The wheel performs a callback into the client-side script.

The script issues an ajax request to a public ip address.

The public address is forwarded to the server-side php.

The php writes the new color to a shared file.

The file is read by a perl script ten times a second.

The perl script shifts the color into array.

Each element of the array is parsed and scaled.

The scaled data is translated into Txtzyme programs.

The Txtzyme programs are written to the serial usb device.

A Teensy microcontroller reads the programs from usb.

The program sequences signals to address a bulb.

The addressed bulb reads its new color from the wire.

All the new colors appear in a blink.

This repeats to scroll colors around the house.

These fourteen steps are typical of modern, HTML5, Polyglot programming. Interestingly, both the client side Javascript and the device driving Txtzyme are dynamically loaded and interpreted from text served from an old laptop running a varient of Unix and serving as the communications hub.

New skills required to code this way include searching for snippets and modules online and debugging their assembly client-side with new developer tools.

I find it is also important to keep every representation as simple as possible because there sure are a lot of them.

Get the iPhone App

Christmas Lights App at Home on the iPhone Dock

You can operate the application from the website on your computer or your phone. You can also save the app by choosing Save to Home Screen from your Safari browser. From there you can move the app around as I have. It now replaces the BBC app that once held this prime screen real estate.