Arduino

Program the Adruino LittleBit to play the Jeopardy theme song 

STEP 1

Open the Arduino software on the computer

Download the "Play A Melody" sketch & open it in the Arduino App 

NOTE: The Play A Melody sketch is zipped in a folder with a supporting file (called a library) named pitches. You'll need to keep these two files in the same folder or the sketch won't work.

STEP 2

Build your circuit (see the photo to the left for an image of the setup). Make sure the speaker is connected to the D9 output pin.

STEP 3

Plug the micro USB cable into both the Arduino module and a USB port on your computer.

STEP 4

Turn your power module on. You should see a red light illuminate on the power module and a yellow light flash on your Arduino module.

STEP 5

In the Arduino program, select your board. Go to Tools>Board>Arduino Leonardo. This littleBits Arduino module is modeled after the Arduino Leonardo and is therefore compatible.

STEP 6

Next select the serial port that the Arduino will communicate over by going back to "Tools" and selecting the correct port in the "Port" section. The name of the port will depend if you are on a Mac or Windows computer. On a Mac, it will start with /dev/tty.usbmodem... and a PC will start with COMM… In Windows, you can look for the USB serial device in the ports section of the Windows Device Manager. If you are on a Linux machine, the port will look like /dev/ttyUSB…

STEP 7

To upload the Arduino sketch to your Arduino module, press the arrow button in the top left corner of the screen. You will see a blue bar at the bottom of the window that says "compiling sketch", and you should see two yellow lights flash on your Arduino module when this happens. The upload is complete when you see "done uploading" at the bottom of your sketch window.

STEP 8

Once the program is uploaded, you will hear the Jeopardy theme song play on the speaker.

STEP 9

Switch up the song by changing the order of at least 4 notes and at least 10 note durations in the code.

Step 10

Delete the code from the Arduino. 

Activity by: https://littlebits.cc/projects/play-a-melody