This is a game for Rainbow HAT for Android Things in which the aim is to find the sequence of the ABC buttons to press, which if followed in correct order, will play out the "do-re-mi" melody. The player's seek time is measured for an element of competitiveness.
Pre-requisites- Android Things compatible board
- Android Studio 2.2+
The round is won when the player completes the sequence after which the alphanumeric display displays WON!
followed by the time it took the player to win
- The game starts when the 3 step counter reaches zero and game timer starts
- The player needs to guess the order of the 8-step order of the A, B, C buttons
- When pressed in correct order, the buzzer plays the “do-re-mi” melody, and the led strip lights up the leds one by one, from left to right
- When an incorrect button is pressed a low-frequency sound is played out, the led lights reset and the player has to guess the order from the start
- A game is restarted by pressing on the buttons again, when a new sequence of steps is generated, and next players can attempt to complete their rounds in fastest time
The game makes use of the following individual components provided by Rainbow HAT:
- Buttons
- Gpio Leds
- Piezo Speaker
- Apa102 Led Strip
- Alphanumeric Display
Classes which provide access to these components implement things.supplier.*Supplier
adapter interfaces and contain minimal logic to enable replacing them with other compatible devices, or a subset thereof, or stubs in tests. There are unit tests which do just that in the test
source set. The logic of interaction with the devices is implemented in their respective things.controller.*Controller
classes. A game contains of rounds which are initiated and announced when completed by GameController
class, and Player’s *moves/guesses* are validated by Game
class.
Build and install: In Android Studio, click on the "Run" button.If you prefer to run on the command line, type:
./gradlew installDebug
adb shell am start com.tomaszrykala.dorefindmi/.DoReFindMiActivity
SchematicsNo idea, I’ve used Rainbow HAT (contributions welcome).
Comments