Lights is an iOS app that controls an RGB LED strip connected to an Arduino.
Lights allows you to change the color of the LEDs, animate the LEDs, and schedule events.
Lights uses a central WebSocket server to proxy commands from the iOS app to the Arduino. In theory, this project could be modified so that the WebSocket server runs directly on the Arduino, thus removing the need for a separate server, but that is outside the scope of this project.
Note: See the doc folder for more information such as the app’s API in case you wish to code your own Arduino sketch or WebSocket server.
Your exact setup may vary, but here is a list of parts that my setup uses (All links are to Adafruit.com, but many parts can be found cheaper elsewhere on the internet):
Note: Any WS2801 LED strip will work without modification to my Arduino code.
Note: These last two items on this list may vary depending on your exact needs. For example, to power more LEDs, you may need a more powerful power supply.
This is just to connect the LEDs to the Arduino. I, for example, just used a few breadboard wires that I had lying around in place of this.
The Arduino sketch requires several third-party libraries, all of which can be found on Github. Download each one and place it in the libraries folder of your Arduino directory, which, in my setup, is ~/Documents/Arduino/.
Open the Arduino sketch Lights.ino which is included in this repository.
Edit lines 7 and 8. Line 7 is the MAC address of the Arduino ethernet shield. This can be found on a sticker on newer shields. Line 8 is the local IP address to be assigned to the Arduino on your network.
You may need to edit lines 10-12 depending on your configuration.
Edit lines 18-20. These lines tell the Arduino where your WebSocket server is.
Upload the sketch to your Arduino.
Follow the tutorial here.
forever start app.jsNothing special is required for this part. Just open the Xcode project, build, and install. The server address can be set from inside the app.