- Posted: Mar 08, 2013 at 6:00AM
- 5,857 views
Today's Hardware Friday project by Georgi Hadzhigeorgiev is one that's a little unusual in that there's not only Netduino code but also an Arduino version available too. I thought that kind of cool, seeing both in one post... Also there's just nothing like a little Rock-Paper-Scissors.
Been constantly persuaded by my 6 years old daughter to play Rock-Paper-Scissors I decided that we can make it a bit more interesting, so I’ve put following schematics on the prototyping shield:
Netduino and Arduino are pin compatible, but the output voltages are different: 3.3V for Netduino and 5V for Arduino. For current limiting, I’ve selected 150Ohm resistor to avoid changing the elements, when change the platform. The 10K pull-down resistors assure false state on the digital inputs until button is pressed.
What the code is doing and how to play:
After MCU initialise, RGB LED becomes steady GREEN thus indicating first player’s move. In secret from the other player, press the chosen button (from left to right in order: ROCK, PAPER, SCISSORS). RGB LED becomes steady RED and now this is the second player’s turn (at that stage of the game, the player may not press the button in secret any more). After the second player’s choice, the RGB LED will flash with the winners colour: GREEN (first player), RED (second player) and BLUE for TIE. Few seconds later, game restarts and you can play again.
BTW, while your there, make sure you check out his Netduino for beginners tutorial! (Yes, it's a two for one kind of day...