Earlier in this guide, we used some code to blink an LED and control the WS2812b LED strip. Now, we're going to use the same Arduino Uno + WS2812b setup to display what we program within the MIT Illuminations app.
The instructions here mirror the Getting Started Guide on the MIT Illumination GitHub README file, with a couple of minor exceptions. This guide is specific to the components that we've been using throughout this project!
If you've been following along with the whole learn.illuminations guide, you should have the hardware setup ready to go from Chapter 5.
If you're starting here, welcome! The setup of the Arduino Uno and the WS2812b LED strip is fairly simple. You need to connect 3 wires from the copper pads on the light strip into the Arduino pins. Double check to make sure you have these connections:
To control the lights using the MIT Illuminations app, we need to add a bit of code to make sure the Arduino can communicate with the app smoothly.
Open the Arduino IDE and copy the code from this link into a brand new blank sketch.
In the sketch, you'll want to check on 3 variables:
LED_COUNT
to the number of LEDs in your WS2812b LED strip (you may want to limit it to something like 24 if you have a long strand).N_COLORS
should be 3 for 3 RGB units.DATA_PIN
is set to 4 (since you're connecting the LED strip Din to PIN 4 on the Arduino).Make sure you have your Arduino Uno selected within the IDE and click "Upload" to publish the code to your Arduino. After that, you can close the IDE, and your Arduino will remember and run this code every time it powers on. As long as your Arduino Uno is plugged into your computer via USB, it will always be ready to accept data from the MIT Illuminations app.
COM...
/dev/tty...
If everything is working, your WS2812b LED strip should be lighting up and matching the preview shown in the MIT Illuminations app. You can start by editing some of the templates, or go wild and create your own. Have fun programming!