Two-Axis-Photocell-Controlled Cursor for Rhythm Game
This game was intended to be a rhythm based music game where the user controls the green flashing cursor to chase down and collide with a larger pinkish white circle before it disappears in order to cause it to "explode" and score a point. In order to make rapid cursor movement more easy two photocells were used for the x and y axis to allow quick and precise cursor control.
Components and Libraries Used
- Photocells
- SD Card Reader
- uLCD Screen
- AnalogOut Speaker with wave_player
- rtos library.
Pinout
SparkFun MicroSD Breakout Board
MicroSD Breakout | mbed |
CS | 8 (DigitalOut cs) |
DI | 5 (SPI mosi) |
VCC | VOUT |
SCK | 7 (SPI sclk) |
GND | GND |
DO | 6 (SPI miso) |
CD |
uLCD
mbed | uLCD Header | uLCD cable |
5V=VU | 5V | 5V |
Gnd | Gnd | Gnd |
TX=P28 | RX | TX |
RX=P27 | TX | RX |
P26 | Reset | Reset |
Speaker
Hooked up to AnalogOut p18 on mbed
Photocell
Hooked up to AnalogIn p15 and p16 on mbed.
On the photocells I did use potentiometer in series with the pulldown resistor for tuning the photocell controls to have a good control range depending on the current lighting environment.
Video Demonstration
Code Used
Import programLab4Game
Lab4 4180 photocell controlled cursor game
Please log in to post comments.