2013-11-08

RPI037

Summary

The Raspberry pi is a single board computer that is designed with an aim of providing help in the computer education to students at school. This is a nice platform to try different programming techniques and learn software tools also. The board is provided with a RCA connector which can be used to connect it directly to a TV screen which is based on PAL and NTSC standard. The board also has a HDMI connector output which can be used to connect the board to a HD TV. One can also use remote login to access the Raspberry pi and view the GUI (Text User Interface) on the PC screen. The Raspberry pi board is also very easy to interface with external devices or circuits through its pin outs. This board is also provided with an audio socket also. All these makes the Raspberry pi a suitable platform for playing and developing interesting games.

This article focuses on how to add sound to a game that is coded to be played with a Raspberry pi gamepad. This simple graphical game is coded using the HTML5 and JavaScript language and interfaced it with a simple game pad hardware connected to the pins of Raspberry pi board. This game is added with a background music and keypad tones which can be enjoyed while playing with the help of a headset or sound system.



Normal

0

false

false

false

EN-US

X-NONE

X-NONE

The gamepad is a simple circuit built on a breadboard with few buttons, LEDs and a resistor array. There are eight general purpose IO pins on the 13*2 pin connectors of the Raspberrypi board and among them four pins has been selected as input and then remaining four pins as output. The input pins are connected to push button and are pulled down using 1K resistors. The output pins are connected to the LEDs through another set of 1K resistors.

For this project the Raspberry pi board is loaded with Ubuntu and is remotely accessed using VNC. To access the pins that coming out of the Broadcom controller the C library “bcm2835” has been downloaded and installed. This article focuses on how to add sound to a game that is coded to be played with a Raspberry pi gamepad.

 

Circuit Diagram



Video

Code

This Code is only visible to Registered users. Please Login/Register

Code2

This Code is only visible to Registered users. Please Login/Register

read more

Show more