Today I was working through some hardware things! I wanted to play with the neopixel LED strip, and also play with using buttons to control the lights on the strip.
First, I played with displaying lights on the strip, and then reading input from a button to trigger a light loop on the strip. This ended up being pretty easy. One thing we learned was that the buttons I have are pull up buttons - when pressed, their state is 0, and they need to be connected to ground (rather than powered).
Once I got the single button working, I hooked up 4 buttons total to be able to play a simplified simon says game. The game displays a random pattern of the four colors, and the player has to remember the pattern and attempt to input it correctly. The user never currently loses the game, they would basically essentially win if attempting to click all buttons for each turn. That’s a future optimization.
The user also can’t restart the game, so that’s what I want to enhance, too. This game play might also be more interesting for a series of LEDs (in a particular position) that the user should click to match the pattern, but again, that’s a future optimization. Having a button to start / stop game play would also be cool.
Not bad for just a couple hours of hacking!