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).

/media/uploads/ykuris3/wp_20170313_002.jpg

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

/media/uploads/ykuris3/_scaled_speakerdriverschem.png /media/uploads/ykuris3/121.png

/media/uploads/ykuris3/sdc.png /media/uploads/ykuris3/captureulcd.png

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


Please log in to post comments.