2 Player Wireless Pong w/ ESP 8266 Webserver and Xbee

OVERVIEW

This project is a wireless version of a 2 player pong game. The game is displayed on a visual studio based GUI available two separate screens and 2 mbeds programmed as the game controllers. Both mbed controllers have an analog joystick used to move the pong paddles left and right in the game, an xbee to communicate player 1's movement to player 2's board, a speaker with a sparkfun audio amplifier, an SD card read/writer, and a Huzzah ESP8266 wifi module to display the total player 1 and player 2 wins on a web page.

To initialize the game, both players have to connect their mbed controllers via USB to two computers with the pong executable program.The players then open the program and wait for their mbed's central light to flash continuously, showing that data is being transferred.

Once the game is initialized, both players are shown a start screen:

start screen

Player 1 and Player 2 can click start by pushing down on the analog joystick. The player the clicks start first will be shown a "waiting for second player" message until the second player also clicks the start button.

waiting screen

Once both players click start, the pong game begins. The pong ball initially starts in the middle of the screen and is randomly sent to either player. The object of the game is to make your opponent miss the pong ball sent in his or her direction. The match continues until one player scores 5 times and a new match can then begin.

you win

The total amount of wins for Player 1 and Player 2 are stored on the SD card in player 1's controller. The scores from the card can be accessed online through the wifi module's local IP address.

DEMO

CODE

The program for both mbed controllers can be imported below:

Import program4180FinalLab_Player1

player 1

The visual studio code for the Pong program is available via github:
https://github.com/Mpmart08/ECE-4180-Final-Project

WIRING GUIDE

Analog Joystick

mbedAnalog Joystick
VOUTVCC
p16VERT
p15HORZ
p14SEL
GNDGND

Class D Amplifier and Speaker

mbedClass D AmpSpeakerExternal 5V Supply
p25IN+
OUT++
OUT--
PWR+5V
GNDIN-, PWR-GND

Xbee

mbedXbee
p9RX (3)
p10TX(2)
VOUTVCC 3.3 (1)
GNDGND (10)

SD Card Reader/Writer (Player 1 only)

mbedSD Card Reader/Writer
p8CS
p5DI
p7SCK
p6DO
VOUTVCC
GNDGND

Huzzah ESP 8266 Wifi Module (Player1 only)

mbedESP 8266External 5V Supply
p26Reset
p28RX
p27TX
V++5V
GNDGNDGND

IMAGES

Game Set-Up

300

Player 1 Controller

300

Player 2 Controller

300

Wifi Webpage

300

Developed by:
Michael Martin Section-B
Rishi Bhargava Section-A
Fese Epie Section-B


Please log in to post comments.