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
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
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
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
- Xbee ZigBee
- uLCD-144-G2
- Thumb Joystick
- Speaker - PCB Mount
- Driver Transistor for Speaker
- IMU Breakout
- Momentary Pushbutton Switch - 12mm Square
Wiring
Xbee ZigBee
mBed | Xbee |
---|---|
3.3V | 1 vcc |
rx (p10) | 2 dout |
tx (p9) | 3 din |
dout (p11) | 5 reset |
gnd | 10 gnd |
uLCD
mBed | uLCD |
---|---|
p28 (tx) | rx |
p27 (rx) | tx |
p29 | reset |
gnd | gnd |
vu | 5v |
Joystick
mbed | joystick |
---|---|
vout | vcc |
p15 | vert |
p16 | hort |
gnd | gnd |
Speaker and Amp
mBed | Speaker | Amp |
---|---|---|
- | C | |
vcc | + | |
gnd | E |
IMU
mBed | IMU |
---|---|
gnd | gnd |
vout | vdd |
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.