In this recipe, we will learn how to control two separate NeoPixels with two independent push buttons. This is a fun and simple way of creating interactivity with your device. Here, you will get immediate feedback from the board the moment you press each push button, as the pixels will light up in response.
Controlling LEDs with push buttons
Getting ready
You will need access to the REPL on the Circuit Playground Express to run the code presented in this recipe.
How to do it...
Let's perform the following steps:
- First, run the following lines of code in the REPL...