Snake on mBed
Overview
The Snake game featured in early Nokia phones can be played on a mbed LPC1768 board using the MPR121 touchpad (4), uLCD-144-G2 (3), SD card reader (1) and a speaker with an 2N3904 transistor amplifier (2).
The game code is written in C++ and tested on mbed's compiler. Since image and sound effects are involved, the Real Time Operating System (RTOS) is utilized. Processes are executed by using the Mutex lock, allowing the use of multiple threads. Sound effects are read from an SD File and outputted to the speaker using the WavePlayer library (2).
Demonstration
Connections
Code
This program is developed by Lotanna Okoli. Hardware setup is done by Yusuf Ziya Kuris.
Import programSnake_game
C++ code for snake game
Libraries Used
- 1. https://developer.mbed.org/cookbook/SD-Card-File-System
- 2. https://developer.mbed.org/users/4180_1/notebook/using-a-speaker-for-audio-output/
- 3. https://developer.mbed.org/users/4180_1/notebook/ulcd-144-g2-128-by-128-color-lcd/
- 4. https://developer.mbed.org/users/4180_1/notebook/mpr121-i2c-capacitive-touch-sensor/
- 5. https://developer.mbed.org/handbook/RTOS
Please log in to post comments.