loading

If you enjoy my work then Please consider going and donating a small amount of money to me to help fund an open source tablet I'm currently working on for a future project.

http://www.gofundme.com/Rpitablet

-Thanks
----------------------------------------------------------------------------------------------------------------------------------------------

Hello there everyone, Pure Carbon is back with another Instructable. The last month I've been working hard to get my YouTube channel up and going. It has been hard, so I haven't been able to make as many Instructables as I used to and I apologize for that, but if you want to check out my channel click the link here:

https://www.youtube.com/channel/UCp1Iy_qqZl-TBWrwOIE5ALw

In this Instructable I will be showing you guys how to play the song Scary Monster and Nice Sprites on an Arduino if you've never heard the song before I recommend you go check out because it's awesome. If you've ever worked with Arduino before then this project will be easy for you. If not then the first thing you should do is go here and download the Arduino IDE software. This will allow you to upload the script that I wrote as well as write your own scripts. The next thing you'll have to do is purchase an Arduino. I recommend the uno which you can purchase here which will cost you about $25. If your feeling adventurous then I recommend purchasing the Funduino Mega which costs $15 and has way more pins, this is the one that I've been using and I have no complaints.

I hope you like this Instructable, be sure to follow to me for many more instructables like this one coming soon and go to my YouTube channel and subscribe to me there, also if you like this then be sure to favorite it. If you have any questions or comments then be sure to leave them below, I'm very good at responding and if I don't right away then just be patient and I will respond to you soon, thank you.

Step 1:

Here's what you will need to make this:

  1. An Arduino (Uno, Mega, Micro, etc)
  2. A small speaker (I used a piezo buzzer which can be purchased here)
  3. A USB cable to upload the code to your arduino
  4. The Arduino IDE software already installed on your computer

Step 2:

First to start you will need to connect the speaker to ground and pin 11 as shone in the picture. If you connect it to any other pins besides 11 it wont work, this step is very easy.

Step 3:

Next copy The following:

#include "pitches.h"

int melody[] = {
NOTE_E3, NOTE_E4, NOTE_D4, NOTE_E4, NOTE_G4, NOTE_D4, NOTE_B4, NOTE_A4, NOTE_G4, NOTE_D4, NOTE_D4, NOTE_C4, NOTE_B3, NOTE_G3, NOTE_E3, NOTE_D3, NOTE_E3, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_B4, NOTE_G4, NOTE_E4, NOTE_D5,
NOTE_E4, NOTE_D4, NOTE_E4, NOTE_G4, NOTE_D4, NOTE_B4, NOTE_A4, NOTE_G4, NOTE_D4, NOTE_D4, NOTE_C4, NOTE_B3, NOTE_G3, NOTE_E3, NOTE_D3, NOTE_E3, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_B4, NOTE_G4, NOTE_E4, NOTE_D5,
NOTE_G3, NOTE_G3, NOTE_G3, NOTE_D4, NOTE_B3, NOTE_B3, NOTE_B3, NOTE_B3, NOTE_G3, NOTE_A3, NOTE_B3, NOTE_D4, NOTE_B3, NOTE_G3, NOTE_G3, NOTE_G3, NOTE_D4, NOTE_G3, NOTE_G3, NOTE_G3, NOTE_G3,NOTE_G3, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, NOTE_FS3, NOTE_E3,
NOTE_G3, NOTE_G3, NOTE_G3, NOTE_D4, NOTE_B3, NOTE_B3, NOTE_B3, NOTE_B3, NOTE_G3, NOTE_A3, NOTE_B3, NOTE_D4, NOTE_B3, NOTE_G3, NOTE_G3, NOTE_G3, NOTE_D4, NOTE_G3, NOTE_G3, NOTE_G3, NOTE_G3,NOTE_G3, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, NOTE_G3, NOTE_G3, NOTE_G3,0,
NOTE_E1, NOTE_A2, NOTE_E1, NOTE_E1, NOTE_E1, NOTE_E1,
NOTE_E1, NOTE_A2, NOTE_E1, NOTE_E1, NOTE_E1, NOTE_E1,
};

int noteDurations[] = {
6,6,6,6,3,6,6,6,6,3,6,6,6,6,6,6,6,6,6,6,6,6,6,6,2,
6,6,6,3,6,6,6,6,3,6,6,6,6,6,6,6,6,6,6,6,6,6,6,2,
6,6,6,2,2,6,6,6,6,8,8,8,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,2,2,6,6,6,6,8,8,8,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,2,2,
1,2,4,4,1,1,
1,2,4,4,1,1,
};
void setup() {
for (int thisNote = 0; thisNote < 120; thisNote++) {
int noteDuration = 1000/noteDurations[thisNote];
tone(11, melody[thisNote],noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
noTone(11);
}
}
void loop() {
}

and paste it to the Arduino software.

Step 4:

Next hook up your Arduino via USB, then click the upload button located in the top left corner. It will look like an arrow pointing towards the right side of your screen.

Step 5:

If everything went ok then you should see some lights flashing on the Arduino, this means that it worked and you should start to hear music playing. Thanks for checking out my Instructable, if you like this Instructable then be sure to favorite it and follow me for many more like this coming soon. Also subscribe to me on youtube here.

<p>To make this work you will have to create the &quot;pitches.h&quot; include file first. Here is how you do this, scroll to the middle: <a href="http://arduino.cc/en/Tutorial/Tone" rel="nofollow">http://arduino.cc/en/Tutorial/Tone </a> </p><p>Anyway: funny! Will try with a proper speaker. </p>
The ending of the video is funny. I like the ending of the video.
Thank you!

About This Instructable

3,369views

36favorites

License:

Bio: My whole life I have thought of ways to make things that you can only go out and buy, follow me and I will teach ... More »
More by Pure Carbon:DIY World Map Computer Decal  Worlds First Remote Control Human Through the Internet Simple Arduino LCD Game! 
Add instructable to: