This is the hardware for a game I’m developing that uses an ultrasonic distance sensor.
The microcontroller (Arduino, natch) randomly generates distances and then commences a ‘random walk’ from Point A to B. You, the player, hold your hand above the ultrasonic distance sensor (aka ‘pinger’) and the microcontroller compares the target distance with your distance. If you are within the ‘safe’ zone, you get a green LED light. If you are in the caution zones, yellow, and red is for when you’re way off.
In addition to lights, there is a piezo speaker which sounds increasingly high pitched tones when your distance doesn’t match the target.
Thus the object of the game is to move your hand so that it keeps in the green zone as much as possible. Points will be scored in the final version, and there will be different skill levels too. Following is a video of how it works so far. Please be patient, the gameplay is still in the development stage.
I’ve already gotten suggestions about generating oscillating waves and musical patterns in which distances correspond to musical notes. Please let me know if suggestions have occurred to you as well.
Buy at Amazon: