Wireless Multiplayer Game Dev Board Using Xbee

Jeremia Bezner, Yeong Cho, Keerthan Tito

Overview

This project is a development board that makes it convenient to prototype multi-player games on mBed. Each board can have several input types: an IMU, a joystick, pushbuttons, etc.; and output types: an uLCD, speaker, etc. The modularity of the code allows IO devices to be easily added and/or removed. The two mBeds communicate wirelessly over RF via Xbees. A prototype casing was also developed.

Diagram

/media/uploads/keerthantito/diagram.jpg

As seen in the diagram above, two mBeds communicate using Xbees. The slave mBed will send all input values to the master mBed, which will then send back processed game frames. This ensures that both devices have synchronized frames.

Xbee

/media/uploads/keerthantito/xbee.jpg

For this project, the Xbees were used in AT mode. In AT mode, one Xbee will immediately send any data from another Xbee that is set as the Destination Address in memory. Using Xbees in AT mode is optimal for this project since only 2 Xbees are used and both are paired with an mBed.

Casing

/media/uploads/keerthantito/casing.jpg

This casing prototype was created using styrofoam. This casing is intended for convenience when handling the gaming board. It can be optimized by 3-D printing or laser cutting its pieces.

Parts Used

Wiring

Xbee ZigBee

mBedXbee
3.3V1 vcc
rx (p10)2 dout
tx (p9)3 din
dout (p11)5 reset
gnd10 gnd

uLCD

mBeduLCD
p28 (tx)rx
p27 (rx)tx
p29reset
gndgnd
vu5v

Joystick

mbedjoystick
voutvcc
p15vert
p16hort
gndgnd

Speaker and Amp

mBedSpeakerAmp
-C
vcc+
gndE

IMU

mBedIMU
gndgnd
voutvdd
sda (p9)sda
scl (p10)scl

Demo

The demo shows the game dev board playing a simple game of tic-tac-toe using a joystick and pushbuttons. The master mBed's uLCD and the slave mBed's uLCD show the development of the game in real time. Each player takes a turn until there is a winner and loser, which is displayed on the respective screens.

Code

For master mBed:

Import program4180final_receiver

4180 Final - Receiver

For slave mBed:

Import program4180final_sender

4180 Final - Sender


Please log in to post comments.