Programming the ESP8266 Huzzah for CheerLights
In this section, we will learn how to program the ESP8266 Huzzah to link up with the CheerLights API and talk to NeoPixels.
Let's try a simple single-color display
We are almost done with our funky networked blinking lights now; all we need to do is program the ESP8266 with the CheerLights code. For this, connect the ESP8266 with your computer again and switch back to the Arduino IDE:
Include the libraries: The first thing we need to do in the code is include the libraries we will need. We need the Adafruit NeoPixel library and
ESP8266WiFi
library. Start with including these libraries:
/* CheerLights * Let the world set your LED strip's color using twitter. */ #include <ESP8266WiFi.h> #include <Adafruit_NeoPixel.h>
- Preprocessor directives: Since we have connected the NeoPixels (via level shifter) to pin 13 on the ESP8266 Huzzah, we must define that as well. So add the following to your code:
...