Physical computing state machine tutorial - State machine traffic light with night mode switch

Control individually timed actions and let the user override them. How to pack different data-types in a struct and use the switch case statement with Arduino

Setup

You can click the image to play the associated YouTube video

Alt text

Schematic

State diagram

BOM

€ 14,00 Adafruit Metro Mini 328 5V 16MHz microcontroller
€ 36,00 3 Adafruit NeoPixel Rings 16 x 5050 RGB LED
€  1,00 Tactile button momentary switch
€  4,00 Half-size transparent breadboard
€  1,00 Jumper cables
€  1,00 2,1mm DC barrel-jack
€  1,00 0,1 µF (104) 10V ceramic capacitor
€  8,00 MEANWELL GS12E05-P1I PSU
€ 66,00

Useful links

μc https://www.adafruit.com/product/2590
LED ring https://learn.adafruit.com/adafruit-neopixel-uberguide/downloads
LED library https://github.com/FastLED/FastLED (see also Wiki pages)