loading

Step 1: Hardware setup

For this setup we will be taking advantage of the internal pull up resistors that the Adruino Nove and newer have built in.

First you'll want to lay out your buttons on the bottom section of your Breadboard. We'll tie one lead of the buttons directly to ground. The other lead will be wired to the Arduino's Digital pins 2, 3, 4, and 5. I ran a wire to the top half of the board to keep the wires running from the board to the Arduino out of the way. 

Now we want to lay out the LEDs above the buttons. We'll plug the LEDs in with the switches so the Cathode is on the same strip as the side of the button that is tied to ground. Well arrange it so the Anode plugs in off to the side of the button. Now we'll take out 100 Ohm resistor and put it inline with the Anodeto the top section of the breadboard. Now we can connect a wire from the resistor to the Arduino.  The LEDs will be using Digital pins 8, 9, 10, and 11. So make sure the buttons and LED are lined up as follows:
  • Button on pin 2 with LED on pin 8
  • Button on pin 3 with LED on pin 9
  • Button on pin 4 with LED on pin 10
  • Button on pin 5 with LED on pin 11
Finally we connect the Speaker so that the black wire is to ground and the red wire is on pin 12 through. You can add a 10K potentiometer in line with the 1K resistor to give yourself a volume control. But i found the speaker is just load enough as is. Lets not forget to supply a ground wire between the Arduino and the breadboard. 
<p>Hello, </p><p>I made the connections, copy/pasted the tone folder under libraries folder, uploaded the code into arduino uno(chinese clone) but nothing happened. </p><p>I checked the connections multiple times. I even asked someone else to check the connections but no fault is found.</p><p>There is only one warning when I upload the code:</p><p>simon_says_audio_ino:15:31: warning: narrowing conversion of '2' from 'int' to 'boolean' inside { } [-Wnarrowing]</p><p>This error repeats for every pin(2,3,4,5,8,9,10,11). Serial monitor gives this:</p><p>Turn: 0</p><p>2</p><p>What am I doing wrong?</p>
<p>Change from &quot;Boolean&quot; to &quot;int&quot; on lines 15 &amp; 16</p>
<p>Hello,</p><p>I've been trying for hours to get this to work, tried 3 different rewires, rotated switches. The code compiles fine, Serial starts and I get the tone through the speaker but no LEDs or input from buttons in Serial. I checked all the comments and tried them but no luck. So i'm finally posting for help, I have two pics up I'm almost certain it's wiring but I can't find any of the problems. Any help would be greatly appreciated, thank you</p>
<p>Well, I couldn't do my version so I may not be the one to answer your question as it should be but if you look at the 1st step/last photo, there is an extra cable for pin 13. </p><p>So if you add that final connection it may work. Or it may not. I couldn't manage what was my problem either:)</p>
<p>Thanks for the try but unfortunately that is just the ground connection I already established, but I have solved it!</p><p>Change from &quot;Boolean&quot; to &quot;int&quot; on lines 15 &amp; 16 worked for me</p><p>LED PROBLEMS with Arduino Starter Kit SOLVED:</p><p>I spent 3 days trying to get this to work and have finally solved it. My big problem was my breadboard wouldn't hold my components and poor connections prevented my LEDs from working. I am using the official arduino starter kit (which is one of the best by the way) and it turns out the metal plates underneath the connect points bend from overuse. </p><p>Solution: <a href="http://forum.arduino.cc/index.php?topic=163989.0" rel="nofollow">http://forum.arduino.cc/index.php?topic=163989.0</a></p><p>Also spacing out components as much as possible on the breadboard helped too</p><p>I also bought new buttons: <a href="https://www.sparkfun.com/products/10302" rel="nofollow">https://www.sparkfun.com/products/10302</a></p><p>but I am fairly certain the breadboard trick will work with anyone having LED problems</p><p>Its refreshing to know I can blame this one on the tech and not myself!</p><p>Thanks for a great tutorial!</p>
<p>i have a program while compiling...please help me bro....the error is shown below</p><p>sketch\Tone.cpp:26:20: fatal error: wiring.h: No such file or directory</p><p> #include &lt;wiring.h&gt;</p><p> ^</p><p>compilation terminated.</p><p>exit status 1</p><p>Error compiling.</p><p> This report would have more information with</p><p> &quot;Show verbose output during compilation&quot;</p><p> enabled in File &gt; Preferences.</p>
<p>Read through all the other comments. This question has been answered several times already. Bottom line you don't have the tone library installed correctly.</p>
I am new to arduino and was wondering where to install the tone library?
<p>C:\Program Files (x86)\Arduino\libraries</p>
<p>Nice project. I added a score system (at the end of the game all led blinks and a note is played, once for each point) :)</p>
it was so fun :) i use 45mm arcade buttons and change buttons and leds from boolean to int in code, a then everything works !
<p>Hey brother, in order to connect the 45mm which jumpers i need to use? can you maybe post a screenshot so i could check out how they are connected?</p>
<p>Should be easy to figure out. The button has pins for the button itself and for it's internal LED. Look at the data sheet for the buttons to determine anode and cathode of the LED and you should be all set. Of course one of the button pins goes to ground while the other goes to the input pin on the arduino. </p>
<p>Thank you taking the time! :))</p>
<p>Superb...</p>
<p>Hello.</p><p>Also the LEDs are not working. When I try each LED and Button separately then they work. In the program only the speaker is working.</p><p>What could be the problem?</p><p>I work with an Arduino UNO.</p><p>Thanks for your help</p>
<p>You're asking the same question many others have had and the answers are outlined in the instructable and reiterated in the below replies. </p>
<p>Yes i know.</p><p>But because the LEDs and the buttons are working when i use another sketch I thougt that maybe there is another problem.</p>
<p>As evident by the examples shown below the code works. So chances are it's user error in wiring. make sure you have things wired to the correct pins. Beyond that there isn't much more help i can give. </p>
<p>Thanks.</p><p>I gonna try again.</p>
<p>i've tried to do this but why is it the LED is not working,..after uploading the program, only the speaker is working,..need help thanks!!!</p>
<p>Most common issue is the buttons are not connected correctly, so at least one button is connected as if it's being pressed constantly. Causing the system to cycle from the intro music, to the first sequence, then it plays the invalid button press and then plays the fail music and starts over again. </p>
<p>I made one of these back on Halloween based on your instructable, and built it in to a foam pumpkin. I also added in a score keeper. All running off an arduino micro. Here's a video of it: https://www.youtube.com/watch?v=a8hAbwgQ0rg</p>
<p>Hey so I've run into some problems with the code, it looks like a lot of people have the same error but I can't fix it no matter what I've done. The errors I'm getting are</p><p>Simon_Says:10: error: 'Tone' does not name a type</p><p>Simon_Says:11: error: 'NOTE_C4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_F4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_C4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_F4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_C4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_F4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_C4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_F4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_G4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_F4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_E4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_F4' was not declared in this scope</p><p>Simon_Says:11: error: 'NOTE_G4' was not declared in this scope</p><p>Simon_Says:13: error: 'NOTE_C4' was not declared in this scope</p><p>Simon_Says:13: error: 'NOTE_C4' was not declared in this scope</p><p>Simon_Says:13: error: 'NOTE_G4' was not declared in this scope</p><p>Simon_Says:13: error: 'NOTE_C5' was not declared in this scope</p><p>Simon_Says:13: error: 'NOTE_G4' was not declared in this scope</p><p>Simon_Says:13: error: 'NOTE_C5' was not declared in this scope</p><p>Simon_Says.ino: In function 'void setup()':</p><p>Simon_Says:26: error: 'speakerpin' was not declared in this scope</p><p>Simon_Says.ino: In function 'void loop()':</p><p>Simon_Says:84: error: 'speakerpin' was not declared in this scope</p><p>Simon_Says:115: error: 'speakerpin' was not declared in this scope</p><p>Simon_Says:115: error: 'NOTE_G3' was not declared in this scope</p><p>Simon_Says:124: error: 'speakerpin' was not declared in this scope</p><p>Simon_Says:124: error: 'NOTE_A3' was not declared in this scope</p><p>Simon_Says:133: error: 'speakerpin' was not declared in this scope</p><p>Simon_Says:133: error: 'NOTE_B3' was not declared in this scope</p><p>Simon_Says:142: error: 'speakerpin' was not declared in this scope</p><p>Simon_Says:142: error: 'NOTE_C4' was not declared in this scope</p><p>Simon_Says.ino: In function 'void input()':</p><p>Simon_Says:169: error: 'speakerpin' was not declared in this scope</p><p>Simon_Says:169: error: 'NOTE_G3' was not declared in this scope</p><p>Simon_Says:184: error: 'speakerpin' was not declared in this scope</p><p>Simon_Says:184: error: 'NOTE_A3' was not declared in this scope</p><p>Simon_Says:200: error: 'speakerpin' was not declared in this scope</p><p>Simon_Says:200: error: 'NOTE_B3' was not declared in this scope</p><p>Simon_Says:216: error: 'speakerpin' was not declared in this scope</p><p>Simon_Says:216: error: 'NOTE_C4' was not declared in this scope</p><p>Simon_Says.ino: In function 'void fail()':</p><p>Simon_Says:244: error: 'speakerpin' was not declared in this scope</p><p>Simon_Says:244: error: 'NOTE_G3' was not declared in this scope</p><p>Simon_Says:250: error: 'NOTE_C3' was not declared in this scope</p><p>I have Arduino 1.0.6. and I downloaded the tone files and they are in the arduino libraries folder. I hope you can help!</p>
<p>All those errors relate to the tone library. Be it in the wrong folder or a change in the IDE now conflicts with the library itself. The change over to 1.0 changed things requiring the tone library to be updated. So it should be fully compatible with 1.0.6. Keep in mind if you store you sketches in another location the IDE creates a library folder there as well. typically in your My Documents folder. So be sure a copy of the library is there as well. </p>
<p>I made this with my 8yo and she loves it! It's her first electronics project.</p><p>We're already discussing ways to customize it! :)</p><p>Thanks!</p>
<p>I made it with my kid (12 y.o.), and have fun both doing and playing with it.</p><p>Thank you very much for very detaled and precise instructions. I changed the source to match my Arduino ide version (I am still on 0022), a matter of minutes.</p>
<p>hi, thanks for project. I applayed this project. has appreciated tremendously. I'm waiting for the continuation of such projects. </p><p>http://youtu.be/iwfzyDovYZ4</p>
I have problem when its compiling here is the error.I am making this at school. <br> <br>Simon_Says\Tone.cpp.o: In function `Tone::begin(unsigned char)': <br>\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:104: multiple definition of `Tone::begin(unsigned char)' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:104: first defined here <br>Simon_Says\Tone.cpp.o:\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:104: multiple definition of `Tone::_tone_pin_count' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:104: first defined here <br>Simon_Says\Tone.cpp.o:\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:104: multiple definition of `timer0_pin_port' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:104: first defined here <br>Simon_Says\Tone.cpp.o:\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:104: multiple definition of `timer0_pin_mask' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:104: first defined here <br>Simon_Says\Tone.cpp.o:\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:104: multiple definition of `timer1_pin_port' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:104: first defined here <br>Simon_Says\Tone.cpp.o:\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:104: multiple definition of `timer1_pin_mask' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:104: first defined here <br>Simon_Says\Tone.cpp.o:\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:104: multiple definition of `timer2_pin_port' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:104: first defined here <br>Simon_Says\Tone.cpp.o:\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:104: multiple definition of `timer2_pin_mask' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:104: first defined here <br>Simon_Says\Tone.cpp.o: In function `Tone::isPlaying()': <br>\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:371: multiple definition of `Tone::isPlaying()' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:371: first defined here <br>Simon_Says\Tone.cpp.o: In function `__vector_14': <br>\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:404: multiple definition of `__vector_14' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:404: first defined here <br>Simon_Says\Tone.cpp.o:\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:104: multiple definition of `timer0_toggle_count' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:104: first defined here <br>Simon_Says\Tone.cpp.o: In function `__vector_11': <br>\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:423: multiple definition of `__vector_11' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:423: first defined here <br>Simon_Says\Tone.cpp.o:\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:104: multiple definition of `timer1_toggle_count' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:104: first defined here <br>Simon_Says\Tone.cpp.o: In function `__vector_7': <br>\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:441: multiple definition of `__vector_7' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:441: first defined here <br>Simon_Says\Tone.cpp.o:\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:104: multiple definition of `timer2_toggle_count' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:104: first defined here <br>Simon_Says\Tone.cpp.o: In function `Tone::stop()': <br>\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:334: multiple definition of `Tone::stop()' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:334: first defined here <br>Simon_Says\Tone.cpp.o: In function `Tone::play(unsigned int, unsigned long)': <br>\\40c\users\627805\documents\Arduino\libraries\Simon_Says/Tone.cpp:191: multiple definition of `Tone::play(unsigned int, unsigned long)' <br>Tone.cpp.o:C:\Users\627805\AppData\Local\Temp\build5323159694636483711.tmp/Tone.cpp:191: first defined here
Look through the other comments and review the section about how to install the library. Those errors are coming up because you don't have the tone library in the correct folder.
<p>instructables is being glitchy so i dont know if you got my comment or not so here it is again. i got it to compile but it just keeps going through the tone and i cant find where to fix that.</p>
<p>First double check your wiring. It's easy to put the buttons in 90 ndegrees off from they way they should be. If that happens then the arduino is going to see it as the button being held down and cuase problems. </p>
how do I change the code so that after 10 rounds a particular event occurs? For example a pin is set to High?
Change the correct line. Then after a successful round have the code compare that line with the number of rounds you want then have it do whatever it is you want it to do. <br>
Thank you for your answer! Can you give me a hint where to find the correct line?
It's noted as the Turn Counter. It tracks the number of turns or rounds that have been completed. Should be no need to change the counter at all. There is no limit set on the counter. All you have to do is after you see the line turn++ add your lines that will compare the turn value to the value you want and perform the actions you want if they match.
Turn++ if (turn &gt;= 10) { digitalWrite(PIN 7, HIGH)}<br><br>Would this line be correct?<br><br>Maik
YEs something like that would work fine.
Where can I change the number of rounds played before winning the game? <br>
Read through the code. The line responsible for tracking rounds is noted.
I modified your code and my family made a &quot;Simon Says&quot; Robot for my son's kindergarten family project, R is for Robot. Thanks for the instructable!!
Hi! Newbie to the Arduino world, so please bear with me. I have followed all the steps and loaded the sketch, when I plug in the USB the lights and speaker just buzz continuously. <br> <br>I am using an UNO. Please let me know if you see anything.
Sounds like you don't have the buttons oriented correctly. Make sure they are all oriented the right way and double check all connections. It's easy to place the buttons 90 degrees off the way they should be facing. Which causes the arduino to see the buttons as being held down constantly.
Thanks I will double check and try!
Hi! i have a problem... <br> <br>https://lh6.googleusercontent.com/bWB1PdpWcJeOb8cWT5zFIJOf7jUcywoihaZAMDPgC1XQmKydXqmqkzrg6C2Z4P_Ynw=w1274-h496 <br> <br>i guess is a library problem. I instaled the tone library corectly like this http://arduino.cc/en/Guide/Libraries <br> <br>I'm running on a Leonardo and the IDE is 1.0.5 <br> <br>Please help me! Thank you!
Your link is broken. <br> <br>If it's a library problem you'll have problems trying to compile and upload the sketch. So make sure you have the library in the correct folder. There is a Libraries folder in the main Arduino folder where you launch the application from. There is also one in your My Documents folder where your sketches are saved too by default. Be sure the library is in both location just to be safe.
As the instructions say on the previous step the pin wire was connected to pin 12. The notation is off here but if you want the speaker on pin 13 then put it there and change the sketch as needed.
Hi, I think you have a mistake here.. <br>&quot;speakerpin.begin(12); // speaker is on pin 13&quot; <br>I think it should be 13 instead of 12??
I think you were correct about the orientation of my buttons. They were all oriented the same way, so they must have all been 90 degrees off. I rebuilt the circuit on my breadboard and it worked this time around. Thanks for the help and your quick responses! <br> <br>Again, sorry about not being able to reply to your message. This comment system is goofy.

About This Instructable

62,182views

67favorites

License:

Bio: I'm a jack of all trades and a master of none. I like to tweak, mod and improvise whenever possible!
More by mpilchfamily:Universal USB Power Supply Kit FM Bug Detector Kit FM Listening Bug 
Add instructable to: