For this class today, you'll need to install:
- Arduino IDE 1.6.8 or higher
- CP2104 USB driver
- ESP8266 Board Package: detailed instructions here. Enter
http://arduino.esp8266.com/stable/package_esp8266com_index.json
into Additional Board Manager URLs field in the Arduino preferences. Then, use the Board manager to install the ESP8266 package.
- Adafruit_NeoPixel: for using the OLED display
- Adafruit_SSD1306: for using the OLED display
- Adafruit_GFX
Run without modifications, just using your Feather HUZZAH.
Confirm that it works by looking at your Feather - is the LED blinking?
Bonus points: modify the sketch to change the blinking pattern (faster, slower, morse code, etc...)
Run without modifications, just using your Feather HUZZAH.
Confirm that the WiFi test is working by inspecting the serial monitor.
Run without modifications, just using your Feather HUZZAH.
Confirm that it works by inspecting the serial monitor. Is it printing the current time?
Run without modifications, using your Feather HUZZAH as well as the OLED FeatherWing. It should display a message!
Bonus points: Modify the sketch to print your own message.
Super bonus points: Can you make the text scroll across the screen? You'll need to know how to program with loops to make this happen...
What if we want to display the time on the screen? We have to combine TimeApi and DisplayTest!
Feel free to copy the solution in DisplayTime_Solution, but you can also do this part by modifying DisplayTest.
Run without modifications, using your Feather HUZZAH as well as the Neopixel FeatherWing. It should blink some pixels!
Let's dig into programming with Neopixels a bit.
Your turn! Try to do the following:
-
Implement a fade effect, so that the display gradually becomes brighter, and then dims back down.
-
Implement a gradient effect, so that the display starts out blue and fades to white.
Check out the solution in PixelFade if you get stuck.
Now for the grand finale. We're going to make a sunrise alarm "lamp". The idea is:
- Set the wake-up time in your Arduino code
- Poll the time API to check if it's the right time
- If so, gradually turn on the lamp
You should be able to build this on your own using the code from PixelFade
and from TimeApi
. If you get stuck, check the solution in SunriseClock!
This is just the beginning of what you can do with your kit! Here's a couple of ideas:
-
Add a buzzer or other sound-making device, so that your alarm "lamp" can also be a normal alarm clock & beep when it's time to really wake up
-
Have the Feather act like a web server, so that you can send a POST request to change the alarm time
-
Find an awesome diffuser to put your "lamp" inside of, so it looks like an actual lamp
-
Add a motion sensor, so that you can turn on the lights when someone walks into the room