Button Clicking Game: With 6 Steps
by Sydneyyy_wang in Circuits > Arduino
967 Views, 1 Favorites, 0 Comments
Button Clicking Game: With 6 Steps
This is a simple game which requires two players to compete to see who has the fastest finger speed!
Game Rules:
After connecting the Arduino board to the laptop, the green LED light at the middle will shine and the buzzer will ring for three times in different tones. After the buzzer stops, the two players should immediately press their buttons. The goal is to click the button as quick as possible until one of the red LED lights at the very left or right starts shining. (E.g. : Player 1 is clicking the left button, if the red LED light at the very left starts shining, player 1 wins the game.)
Credit to: https://www.instructables.com/id/Arduino-Two-Play...
Note: I added a buzzer for the countdown of each game to remind the players to prepare as well as adding excitement and building suspense. Therefore, when the USB cable inserts the Arduino board and the laptop, the buzzer will buzz for three times, which signifies the game has started.
Supplies
- 1 Green LED Light
- 4 Red LED Lights
- 4 Yellow LEDs Lights
- Around 20 wires
- 2 Push-Buttons
- 9 100 Ohm Resistors
- 2 1K Ohm Resistors
- 1 buzzer
- 1 Arduino Leonardo Board
- 1 Breadboard
- 1 USB 2.0 Cable Type A/B
Building the Circuit (Placing Wires)
1) Connect a wire from GND to the negative column on the right
2) Connect a wire from 5V to the positive column on the left
Building the Circuit (Placing LED Lights & Resistors)
1) Place the LED lights with the sequence of " Red => Red => Yellow => Yellow => Green => Yellow => Yellow => Red => Red" (from left to right) *Make sure the longer side of the LED light is placed on the left
2) Place the 100 Ohm Resistors
- One end should be placed on top of the left leg of the LED lights and the other end connects to the negative column
3) Place the wires
- One end should be placed on top of the right leg of the LED lights and the other end connects to the pins
Building the Circuit (Buttons)
1) Place a button on each side of the breadboard
2) Place the 1K Ohm Resistors
- One end should be on top of the left leg of the button and the other end connects to the negative column
3) Place the wires
Left
- First wire: One end should be placed on top of the left leg of the button and the other end connects to the positive column
- Second wire: One end should be placed below the right leg of the button and the other end connects to pin 13
Right
- First wire: One end should be placed on top of the right leg of the button and the other end connects to the positive column
- Second wire: One end should be placed below the left leg of the button and the other end connects to pin 12
Building the Circuit (Buzzer)
1) Connects the black wire to GND
2) Connects the red wire to pin 11
Writing the Code
A single copy and paste from: https://create.arduino.cc/editor/sydneyyy_wang/52... and you will get the code!!!
Final Result
I decorated my breadboard by placing it into a box. To show the LED lights, I poked holes on the cover and use the wires with alligator clips to clip the lights in order to place them into the holes. Therefore, all the untidy wires and resistors will be covered and only leave with several LED lights which make the game looks more attractive and likable.