The concept is really simple, how many times can you press a button in 2 seconds? My current record is 20.
The game counts you in, 5 leds lit, 4, 3, 2, 1 then you press it as many times are you can, it counts up in binary on 5 leds, before showing your high score in binary.
I used 5 leds and one button, connected to the Pi in the following configuration.
Gnd -> 10k resistor (pull down) -> Button -> GPIO 4 -> 1k resistor (protection) -> 3v
GPIO 17 -> Resistor -> LED -> Gnd
GPIO 18 -> Resistor -> LED -> Gnd
GPIO 21 -> Resistor -> LED -> Gnd
GPIO 22 -> Resistor -> LED -> Gnd
GPIO 23 -> Resistor -> LED -> Gnd
The leds are configured in a binary sequence going:
I then wrote the following python program:
Press the button like a maniac... If you beat 20, leave me a comment, but I want proof!