Let's Play Rock, Paper, Scissor!

by enid an in Circuits > Arduino

469 Views, 0 Favorites, 0 Comments

Let's Play Rock, Paper, Scissor!

IMG-0922.jpg

"Rock, Paper, Scissors, Shoot!" "Rock, Paper, Scissors, Shoot!" Let's come and play the most famous and classic two-person game - the rock, paper scissor! But this is no longer a normal mode, it will be a game that anyone can play! Some elderly people don't need to struggle to hold their fist anymore, because this new improvement designed by arduino will allow you to start the game with just the taps of a button! Easy to make, and easy to play. You only need to use the buttons and LED light, and it will bring you a different gaming experience!

How it works?

There will be two players standing on opposite sides, they will each have three buttons, and each button will have a corresponding color. Press the button to light up the LED. The lights are red, yellow and green. The colors like traffic lights represent scissors, rocks, and paper respectively (the colors of traffic lights are related to our lives that made us easy to remember). For example, two players press the button at the same time, if player A is green and player B is yellow, it means that player A is paper, and player B is rock, then player A will win since paper covers rock. Similarly, if both players are red, it means that they both are scissors, so the result will end in a tie.

Hint: Rules of rock, paper, scissors

  1. The Rock rock will crush the Scissors (LED Light Color: Yellow wins Red)
  2. The Scissors will cut the Paper (LED Light Color: Red wins Green)
  3. The Paper will cover the Stone (LED Light Color: Green wins Yellow)
  4. If two are the same, they are tied (LED Light Color: Yellow and Yellow ends in a tie, Red and Red ends in a tie, and Green and Green ends in a tie)

The Overall Introduction of My Project

In this project, we will apply the technique of LED and button in the arduino box. The whole will be look like a box, not too big but not too small. The length, width, and height are approximately 25x15x18 cm (For covering the exposed wires and breadboard). On the upward side, there will be six small circular boxes with holes on it, which are used to display LED lights. It will be arranges in a 2x3 manner (Three on the long side and two on the short side). And there will be a rock-paper-scissors pattern standing there in the middle as a display of decoration and theme. The side area with the short side height will be wrapped with wrapping paper for decoration. And the side area with the long side height will be installed with three buttons (There are six in total, three on each side). And the corresponding rock, paper, scissors are marked below the button. When players press the buttons below, the upper LED light will light up with the corresponding colors.

Prepare All the Materials

IMG-0925.jpg
Screen Shot 2021-05-16 at 4.05.34 PM.png
Screen Shot 2021-05-16 at 4.05.58 PM.png
Screen Shot 2021-05-16 at 4.06.33 PM.png
Screen Shot 2021-05-16 at 4.06.52 PM.png
Screen Shot 2021-05-16 at 4.07.15 PM.png
Screen Shot 2021-05-16 at 4.07.28 PM.png
Screen Shot 2021-05-16 at 4.08.42 PM.png

For Circuit Installation:

- Arduino Leonardo Board x1

- Breadboard x1

- Cable x1 (For connecting your board to your computer)

- Plug Adapter x1 (If needed)

- Button x6

- LED Light x3 (You can change the color if you wanted, mine are just suggestions)

-Two red lights, two yellow lights, and two green lights

- Jumper Cables x31

- Arduino Alligator Clip x12 (For connecting male wires)

- Yellow Arduino Resistors (100 ohm) x6

- Blue Arduino Resistors (1K Ω) x6

For Decoration: (Optional)

- Carton

- Wrapping Paper

- Small Circular Box with Holes on it x6

- Photocopy paper/ drawing of Rock Paper Scissors pattern

Tools:

- Hot glue gun/Tape Dispenser or scotch tape

- Scissor/Box cutter

- Marker/Pencil and eraser

- Rular

- Compass

Setting Up the Board

Screen Shot 2021-05-14 at 3.00.54 PM.png
IMG-0924.jpg
Screen Shot 2021-05-16 at 4.17.54 PM.png
Screen Shot 2021-05-16 at 4.18.09 PM.png

According to the pictures above, insert components on your bredboard.

Reminders:

  • We will need six LED lights, six buttons, and six alligator clips in this section
    • Two yellow one, two red one, two green one
    • All LED lights and buttons have different inserted pin. Although the approaches for the six buttons and LED lights are the same, still need to pay attention to the pins that should be inserted and the pins that are paired with it (Each LED light will be paired with each button, button is the mechanism that makes the LED blink).
      • Button D5→ LED D11 (Yellow)
      • Button D2→ LED D12 (Red)
      • Button D7→ LED D13 (Green)
      • Button D4→ LED A0 (Yellow)
      • Button D9→ LED D6 (Red)
      • Button D8→ LED D3 (Green)
    • Leave space for the components, the space on the bread is limited. When inserting components into the breadboard, try to place them on the edge/make them close to each other.

Use the jump cable to connect 5v to the positive row "+", connect GND to the negative row "-". There are two negative rows/ regions of the breadboard, remember to connect to the both of them (Hint: The light blue jumper cables).

  1. First LED light with button (Yellow LED light for the first player)
    1. Connect digital pin 11 (D11) to the one side of the resistor (same column), and use the other side to connect with the positive side of your LED (same column), finally, use another jump cable to connect the negative side of the LED to the negative row "-" (same column). (Hint: The yellow jumper cables).
    2. Replace the long side of LED with an alligator clip, and then connect the head of the alligator clip with the long side of LED.
    3. Replace the short side of LED with an alligator clip, and then connect the head of the alligator clip with the short side of LED.
    4. Connect digital pin 5 (D5) to the one side of the resistor and one side of the button (same column).
    5. Uses jumper cable to connect the other side of the resister to the negative row "-". (Hint: The black jumper cables in the bottom region).
    6. Connect one side of the jumper cable the same column with one side of the button. The another side of the jumper cable will be connected to the positive row "+". (Hint: The black jumper cables in the bottom region.)
  2. Second LED light with button (Red LED light for the first player)
    1. Connect digital pin D12 to the one side of the resistor (same column), and use the other side to connect with the positive side of your LED (same column), finally, use another jump cable to connect the negative side of the LED to the negative row "-" (same column). (Hint: The orange jumper cables).
    2. Replace the long side of LED with an alligator clip, and then connect the head of the alligator clip with the long side of LED
    3. Replace the short side of LED with an alligator clip, and then connect the head of the alligator clip with the short side of LED
    4. Connect digital pin 2 (D2) to the one side of the resistor and one side of the button (same column).
    5. Uses jumper cable to connect the other side of the resister to the negative row "-". (Hint: The brown jumper cables in the upper part region).
    6. Connect one side of the jumper cable the same column with one side of the button. The another side of the jumper cables will be connected to the positive row "+". (Hint: The brown jumper cables in the upper part region).
  3. Third LED light with button (Green LED light for the first player)
    1. Connect digital D13 to the one side of the resistor (same column), and use the other side to connect with the positive side of your LED (same column), finally, use another jump cable to connect the negative side of the LED to the negative row "-" (same column). (Hint: The orange jumper cables).
    2. Replace the long side of LED with an alligator clip, and then connect the head of the alligator clip with the long side of LED
    3. Replace the short side of LED with an alligator clip, and then connect the head of the alligator clip with the short side of LED
    4. Connect digital pin 7 (D7) to the one side of the resistor and one side of the button (same column).
    5. Use jumper cable to connect the other side of the resister to the negative row "-". (Hint: The brown jumper cables in the upper part region).
    6. Connect one side of the jumper cable the same column with one side of the button. The another side of the jumper cable will be connected to the positive row "+". (Hint: The black jumper cables in the bottom region.)
  4. Same as the steps above, repeat three times to design the code for the second player. But remember to change to the different pins.

Programing the Arduino/ Uploading the Code

Screen Shot 2021-05-16 at 3.46.21 PM.png
Screen Shot 2021-05-16 at 3.46.29 PM.png
Screen Shot 2021-05-16 at 4.03.18 PM.png
Screen Shot 2021-05-16 at 4.03.31 PM.png
Screen Shot 2021-05-16 at 4.03.40 PM.png

The pictures above have some detailed explanation↑

Open Arduino IDE software, and upload the code into your computer (If needed, use USB wires to connect your computer with the board)

When uploading, please make sure that you've checked the board type and the correct serial port first.

Codes ↓ (It is published on the Arduino Editor)

https://create.arduino.cc/editor/enid/80128b8e-9b8...

Decorate the External Look/ Container (Optional)

IMG-0934.jpg
IMG-0933.jpg
IMG-0930.jpg
IMG-0931.jpg
  1. Pack your bread
    1. Directly put it into a shoe box (My recommendation is 25x15x18cm, LxWxH)
    2. Make a box by yourself
      1. Use ruler of measure the length, width and heigh of your breadboard. Use a marker to mark the area to be cut after the measurement
        1. For both length, width and height, measure them from end to end, even the most marginal places must be measure
        2. For the height, cut the board based on the bending level of the wires. Use the highest one as a reference, do not press or squeeze your wires
      2. Use a scissor or a box cutter to cut off the labeled areas on the cardboard.
      3. Use the hot glue gun to stick all the pieces together, place them in a shape like a box
  2. On the upward side of the box, cut six circular holes and use hot glue gun to stick six small circular boxes on it. The arrangement will be in a 2x3 manner (Three on the long side and two on the short side).
  3. Use tape to stick the rock-paper-scissors pattern in the middle
  4. Wrapped the short side lateral area with wrapping paper
  5. Cut three holes on each side of the long side lateral area, and install three buttons into the holes(There are six in total, three on each side).
  6. Use a marker to mark the corresponding rock, paper, scissors below the buttons.
  7. On one piece of the carton, cut off a small hole for the blue line to enter to connect to the breadboard and your computer

Start Testing

Final Project

Thank you for your patience to finish reading my work, and you are welcome to change to a better model freely!

Some suggestions I recommend:

  1. Use LCD Board to score
  2. Use LCD Board for timing
  3. Use Arduino speaker when someone scores