Run as fast as you can . . . with your fingers!
In this game, a player must tap two sensors alternately in order to run laps. One LED will light up per lap. When all laps are completed, LEDs will blink in victory.
Materials
- 1 Arduino board
- 1 Basic Education shield
- 5 LEDs
- 2 1 M ohm resistor
- 5 220 ohm resistors
- 5 black jumper wires
- 11 colored jumper wires (2 long ones)
- aluminium foil
- masking tape
Instructions
Code
You can find the code in?File -> Examples -> Castilla -> Sports -> Racing
How it works
The game begins when you start tapping alternately between the two capacitors – press the left and then the right. For every 20 “steps”, one LED lights up. The LEDs will turn on and off with every step.
Once you have completed 100 “steps”, all the lights will blink in celebration! After that, the game restarts.
Troubleshooting
- Refer to the illustration and double check your connections. Make sure the shield and wires are firmly connected.?Check the LED polarities to make sure they are consistent and properly wired.
- Hitting the foils does nothing? See?Capacitive Switch reference?for debugging capacitive sensor.
- VU-meter does not work correctly? See?VU-Meter reference??for debugging VU-meter.
- You can’t upload the code? Make sure that the CapacitiveSensor library is placed inside the libraries folder in your Arduino folder.
Experiment further
- Change the way the LEDs blink when it’s game over. See code example VUMeterTest for the commands you can use.
- Is the game too easy? Make it longer!
- Find other conductive materials to replace the aluminium foil with (maybe your friends)?
- Use a stopwatch and see who runs the fastest!