Step 8: The X10 Code

You can download my code below. The system runs like this:

1. The key switch turns on the red alert alarm, cyclon LED sequencer on top of box, the "police flashers" on the side of the box, and the Arduino itself. (I did it this way to save power and prevent the Arduino from being powered up all the time.) The flashers and cyclon are will continuously run while the key switch is on. The red alert alarm will continue to run until:

2. The Red guarded switch is turned to the On position.

3. Once the Red guarded switch is closed, Party Mode On is activated. This dims the overhead can lights in the bar and turns on all the cool stuff.

4. Red switch "Off" deactivates Party Mode, turning all the X10 devices off sequentially and returning the overhead can lights to normal. There is a bit of a delay that is do to the way the X10 system works. It really is old technology.

5. Key switch Off shuts the system down.

Simple enough?

Well, hope you enjoyed this tutorial and please message me if you have any questions. I'll try to answer them but be forewarned that I am not an Arduino guru by any stretch, so you might be better off going to the Arduino forum for anything more complicated!