Brought to you by Jason Malinowski, Justin Beck, and Chris Meyer
In brief, we have connected a special device called a relay board to our computer. This device is actually a piece of hardware that is designed to lock and unlock doors, such as the doors that will automatically unlock when you put a security card infront of a sensor. This device also accepts commands that let us manually "lock" and "unlock" doors. However, all the device really does is turns on and off a switch (which is intended to be connected to the locking mechanism), but we can really use it to switch whatever we want. So, in order to turn on and off lights, we simply connect each string of lights to one of the switches, and then "lock" and "unlock" these switches (the commands are literally UNLOCK and RELOCK).
Note that the "switches" inside this piece of hardware are physical switches: internally there actually is something that physically moves to open and close the circuit. This may sound odd, but this is very important as it lets us switch on and off high voltages (120V) with a computer safely without damaging the computer (or ourselves!). The surprising side effect of this is the switches make a click everytime a light turns on or off! So, not only do we see the flashing lights, but we hear sound to go along with it!
For those who are technically inclined, you can read the details about how we put this together: