The inspiration for the game came from a pediatric neurologist. To screen patients for ataxia (impaired coordination), he would tell them to rapidly tap on the table with a pen, listening to the rhythm. The regularity and rate provided insight into the patient's neurological condition.
Many of us have an intuitive understanding of how the way we move and respond can proxy our physiological condition. Our thoughts slow as we tire or become ill. Our movements weaken after repeated strain. Yet, there is still a lot of opportunity to understand these signs more quantitatively, comparing measurements at different times or with different people.
I started this project to test and measure motor and neurological parameters. Originally, I had wanted to make a tapping game that mimicked what the pediatric neurologist would have their patients do, but as I worked on the project, making the tests engaging and kid-friendly became another priority. In the end, I ended up with three games testing fine motor control and reaction speed.
Build Instructions:Wiring up the SPI display:
I used the SPI rather than the 8-bit mode for the ILI9341 Display as I believed speed was not going to be an issue. Note that wire you do not need to follow my exact wiring, the software is optimized (default parameters are set) for these pins on the PocketBeagle:
- Chip select (CS) - P1_6
- Data/command selector (D/C) - P1_4
- Reset (RST) - P1_2
- Lite - P1_20
- MOSI - P1_12
- MISO - P1_10
- Clock (CLK) - P1_8
Also make sure to give the display power. I connected it to 3.3 V on the PocketBeagle (P1_14). Ground was P1_16.
Wiring the I2C Touch Screen Controller:
The I2C Touch Screen Controller connects to the display and the PocketBeagle. The +X, +Y, -X, -Y pins of the controller correspond with the same pins on display. I soldered male 90° headers onto these pins for easy access with male-to-female Dupont wires.
For the I2C connections itself, I used bus 1 on the PocketBeagle corresponding with P2_9 and P2_11 for SCL and SDA, respectively. A 3.3V line with 10 kΩ pullup resistors were used.
Buzzer Wiring:
The buzzer was connected to a pulse width modulation (PWM) pin on the PocketBeagle (P2_1) to control the frequency of the buzzes. The other pin was connected to ground. Mind the polarity (the PWM should connect with the positive end).
Button Wiring:
The button was wired in an active-low configuration. You can also wire it as active-high but make sure to adjust it when calling the button driver software as it is not default. The button was connected to the GPIO pin P2_2.
For software installation, please consult the linked Github page. Make sure to read the API and adjust the pins for the drivers of each component if they were wired differently from above. As mentioned earlier, if you use a different button configuration, make sure to change the default of the button driver to active-high. Additionally, if you use a different-sized screen, ensure that the sizing is updated for the touch screen controller driver or the detected touch coordinates may not be accurate to the locations on the screen.
I recommend testing each component individually as you wire them by running the drivers individually since each one includes test code.
Playing the Game:Follow the instructions that are displayed on the screen. The home screen should look like the following.
There are four different possible inputs. Tapping one of the yellow rectangles will start a different game. After the game is completed, the user will be returned to this home screen. If the user wishes to end the program, they can press the power button in the top right corner. This button will stop the program and turn off the screen. Note that, to restart the program, the PocketBeagle must be rebooted.
Most of the controls for the program are via the touch screen, except for the "Rhythm" game requiring pressing the button for the gameplay itself.
Games Explanation:Rhythm:
The player listens to a randomly generated rhythm, which is two groups (2-4 notes each) with distinct tempos and a 1.5-second pause between the groups. The player must recreate the rhythm as faithfully as possible on the button. Scores are based on the discrepancy between buzzer beeps and button presses. The mean, root mean square, and standard deviation of discrepancy are all calculated.
The game is meant to test motor control and regularity, as well as memory.
Reaction:
The player taps the bubble that appears on the screen as fast as possible. When tapped, the buzzer will beep to notify the player, and the bubble will move to a random location. The player should continue tapping bubbles until time runs out (15 seconds). The number of bubbles tapped, as well as the rate of taps is calculated. The statistics calculated include mean reaction time, fastest reaction time. slowest reaction time, and standard deviation of reaction times.
Speed:
In this test, the player needs to sequentially pop bubbles as fast as possible, starting with the blue bubble and ending with the red. The player can tap or drag, although dragging is usually faster, and is given as much time as they need to prepare since time is only counted once the first bubble is tapped. In the first round of the game, they must tap bubbles from left to right. The second round is from top to bottom. The amount of time to complete each round and the rate of bubble pops are calculated.
The test is meant to assess fine motor control.
Demonstration:
Comments