wireless rock – paper – scissors

04Oct07

Our assignment was to build an automated version of the ever popular game: rock, paper, scissors.  Rory and I sat down and built two xbee radios connected to two arduino stamps and coded a hand shake protocol for communication between the two.  It took us about two hours to workout before we uploaded to the chip and had a full game.  After a little debugging we pretty much had it working  off of our first draft.

you can view our code here.rps01.jpg

To start the game, someone presses a switch on one of the boards.  That starts a counting function 1, 2, 3 between the two, indicated by a green LED blinking, one then the other, on both boards.  Then a random number is generated from a seed()  between 0 – 2, standing in for r, p, or s and indicated on a tri-color LED R,G, or B.  That byte is exchanged and evaluated based on what that board chose and a winner is determined – green led on the winning board blinks 5 times.

Click here to see a demo quick time of the game.

Advertisements


No Responses Yet to “wireless rock – paper – scissors”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: