Chain colors and delays on the neopixel to build a traffic light.
This tutorial is part of the Nairda learning path. You can build it step by step inside the app, which checks every block you place before letting you move on.
The steps
- We create a neopixel called light, with 1 led, on pin 6.
- We add a While loop, which repeats forever.
- Inside the loop we set the neopixel to red.
- Behind it a delay of 3000, which is how long the red lasts.
- Another neopixel, now in green.
- And another delay of 3000, which is how long the green lasts.
When you finish, the app takes you straight to the next tutorial in the path.