MycilaTrafficLight
ESP32 / Arduino Library for Traffic Light LEDs
- Supports standard GPIO leds
- Supports NeoPixel leds (addition from @hallard)
NeoPixel example:
// Argument 1 = pin number (most are valid)
// Argument 2 = Number of pixels in NeoPixel strip (default 3 if omited)
// Argument 3 = Pixel type flags defaut if omited ( NEO_GRB + NEO_KHZ800 )
lights.begin(NEOPIXEL_PIN, NEOPIXEL_COUNT, NEOPIXEL_FLAGS);
// Set BRIGHTNESS to about 1/5 (0.0 to 1.0)
lights.setBrightness(0.2f);
lights.setAllOff();
lights.setGreen(true);
lights.setYellow(true);
lights.setRed(true);
// [...]