mbed pong on uLCD and sliders
Overview
For our mini project we made a simple pong game using a uLCD, push button and 2 slider potentiometer. This game requires two players. Each player uses a slider potentiometer to control their sliding paddle displayed on the uLCD screen. The push button is used by both players to throw the ball. The game begins when either one of the players presses the restart button on the mbed. The ball is first launched at a random angle from the center of the screen to make it a fair game. The two players then use the paddles to bounce the ball to each other attempting to score. When a player scores, that player holds the ball and uses the slider potentiometer to choose a direction in which to launch the ball. To launch the ball the player simply presses the push button. The game keeps score on the top of the screen but the players decide when the game is over.
This video illustrates how the game is played.
Components
Circuit
mbed | uLCD Header | uLCD cable |
---|---|---|
5V=VU | 5V | 5V |
Gnd | Gnd | Gnd |
TX=P9 | RX | TX |
RX=P10 | TX | RX |
P11 | Reset | Reset |
mbed | pot slider 1 | pot slider 2 | push button |
---|---|---|---|
GND | GND | GND | GND |
Vout | Power | Power | |
P18 | Digital in | ||
P19 | Analog in | ||
P20 | Analog in |
Program
Import programLab4pong
pong game
Please log in to post comments.