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

Pinout

SparkFun MicroSD Breakout Board

MicroSD Breakoutmbed
CS8 (DigitalOut cs)
DI5 (SPI mosi)
VCCVOUT
SCK7 (SPI sclk)
GNDGND
DO6 (SPI miso)
CD

uLCD

mbeduLCD HeaderuLCD cable
5V=VU5V5V
GndGndGnd
TX=P28RXTX
RX=P27TXRX
P26ResetReset

Speaker

speaker hookup

Hooked up to AnalogOut p18 on mbed

Photocell

photocell schematic

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.