Cave Runner Game w/Accelerometer and Nokia LCD
Overview
For our project we made a simple game using a Nokia 6610 LCD, ADXL345 accelerometer, and a speaker connected with a MOSFET. The programs shows a title screen with the game being played in the background. When the player presses S1 on the LCD the game starts and a sound plays. The player tilts the breadboard to move the ball and avoid hitting the edges. The difficulty increases over time by increasing the speed at which the walls move. When the player hits the edge with the ball the game ends, a sound is played and the score screen is shown. Pressing S1 again brings up the title screen.
Components
Circuit
LCD Pin | mbed pin |
---|---|
S1 | p18 |
CS | p8 |
SCK | p7 |
DIO | p5 |
RESET | p9 |
GND | GND |
3.3v | 3.3v |
vbatt | 3.3v |
ADXL pin | mbed pin |
---|---|
SCL | p13 |
SDA | p11 |
SDO | p12 |
CS | p14 |
VCC | 3.3v |
GND | GND |
MOSFET pin | mbed pin |
---|---|
+ (System) | VU |
- (System) | GND |
C (System) | p21 |
+ (Device) | Speaker |
- (Device) | Speaker |
Program
This program has a modified version of the Nokia LCD library.
Import programCave_Runner
Cave Runner Game w/Accelerometer and Nokia LCD
Please log in to post comments.