Cyclone Game Using Arduino
by Ahmed Mahfouz22 in Circuits > Arduino
1817 Views, 4 Favorites, 0 Comments
Cyclone Game Using Arduino
I made this game as my "Hello project" in Ardunio so it will not take much time or effort to make, it took from me 2 weeks to made due to lack of resources.
Rules of the game are simple : the light goes from right to left and the first player to press the button while the light on his side is on gets a point, first player to reach 5 points win the game.
Know Your Components
you will need these material before starting in this project
- 1* Arduno UNO (you can use Mega if yo want to add more LED)
- 1* half breadboard
- 1* 9 volt battery
- 1* battery connector
- 1* switch
- 2* push button
- 8* 5mm Blue LED
- 2* 5mm Red LED
- 10* 330 ohm resistor (for each LED)
- 2* 10K ohm resistor (for the two push button)
- 24* male to female wire (to rise the led and buttons from breadboard)
- 14* male to male (to connect led and push button between breadboard to arduino)
For the coding, you need to know the fundamental of C++ and Arduino IDE
Connecting It All
If this is your first project (like me) then you should know that there is a color in each resistor that indicates the resistance in each one , in this project we will use 330 ohm resistor for each LED so they do not get burnt due to high volt, you will also use 10K ohm with each push button.
In the photo above you will see that every component is on the board except the male to female wires and that is up to you to see the right length for the box you are going to put your game in it.
Brain of the Game
Moving now to the code, you will find comment on (nearly) each line of code in the sketch but to make to even more clearly, i will go briefly into it.
Starting from setup () function you will see that the first line is to see the output on the terminal to check that everything is good
At the start of Loop () function there is the first 'block' of the code for the light to go from right to left and the if statement to make sure that the player gets score if only the red led on his side is on and he press the button on the same time, same 'block' of the code is repeated but with the light going from left to right.
Downloads
Making the Box
The original idea was to make a box out of wood but i realized that this would take time and i wouldn't do it at the right dimensions that i want so i went with the easy option which was search for any box that has close dimensions that i want, i found a close one to what i was looking for but that one needed some painting and make holes for the led, button and switch to come out of it.
I took the dimensions of the box and used coreldraw to make the layout of it and make space between each 10 led even and also make space for the button and the switch.
Finishing Up
After making the layout it is now the time to spray the box, there isn't much to talk about here but my tip for you is to use a good spray so it dry after short time and doesn't take 12 hours like mine.
You can use the male to female wire to rise the component from the breadboard to the top of box, my circuit looked like that right before fitting it inside the box. For the 9v battery just connect it to the battery connector then connect it directly to the board.
Finally, It's Alive!
Now you have finished the game, congratulations on doing all that, you can now go and try it with your friends.