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

mbeduLCD HeaderuLCD cable
5V=VU5V5V
GndGndGnd
TX=P9RXTX
RX=P10TXRX
P11ResetReset
mbedpot slider 1pot slider 2push button
GNDGNDGNDGND
VoutPowerPower
P18Digital in
P19Analog in
P20Analog in

Program

Import programLab4pong

pong game


Please log in to post comments.