Doctor's Arduino Game
I make this game for my Arduino class. It takes me 1 week to make. The rule of this game is if the light is red, the left player gets the point. If the light is green, the right player gets the point. The person that first get 3 point wins the game. Also, it can become the light night too.
Inspired by : https://www.instructables.com/id/Cyclone-Game-Usi...
Prepare Your Material
- Arduino UNO
- male wires
- female wires
- 5mm LED
- 330-ohm resistor
- 10k ohm resistor
- cardboards
- A plastic cup that has holes
Connect It All !
Now, you need to connect the wires together. The only thing that you must know about is to distinguish the 330-ohm resistor and 10k ohm resistor. We use 330-ohm to connect the LED so that it can avoid LED burn out, also we use 10k ohm resistor to connect the t-button.
Design the Game
Now we turn our attention to the code. The main structure of the code I already give you down below. You can change the code if you want.
The important part of the code is set up and loop. I will explain to you in detail.
Setup () function you will see that the first line is to see the output on the terminal to check that everything is good. Loop ()there is the first 'block' of the code. The code is about the light that goes from right to left. Also, the if statement is to make sure that the player gets the score. If the light is red, the left player gets the score. If the light is green, the right player gets the score.
The code link: https://create.arduino.cc/editor/doctor9483/cc5e0...
Make the Box
The way I make the box is to cover it with cardboard. I made cardboard on all four sides, and then I glued them together. After that, I cut a few holes in the upward-facing board. The reason is to fix the buttons and LED lights on the cardboard. You can use your own way the make the box. It may be more easier.
Connect With Your Computer and Play It !
Great job!