Skip to Content

How can I try out code in the Arduino IDE?

One way to create an instrument is to use small computers called microcontrollers to control what happens with sound. This requires code. 

A great way to get started creating code for your instrument is try out someone else’s code. 

Think About

How do I send code to a microcontroller using the Arduino IDE?

What types of sounds would I want to make on my instrument?

How do I want my instrument to work?

Get Started

To get started, you’ll need a microcontroller and a USB cable to connect it to a computer.

The type of USB cable you use will depend on your microcontroller.

Open the Arduino IDE and plug your microcontroller into the computer.

Keep Going 

1) Open one of the example sketches. (A sketch is a program that you can upload to the Arduino.)

2) Go to File -> Examples -> 01.Basics -> Blink

[insert pic]

This will open the Blink sketch.

3) Now you need to tell the Arduino IDE what kind of microcontroller you’re using.

Go to Tools -> Board and select your board from the long list that appears. Note that your options will be different from mine.

[insert pic]

4) Then tell the Arduino IDE which port you have your microcontroller plugged into.

Go to Tools -> Port.

If you’re using a Mac, select a port that has usbserial somewhere in the title.

If you’re using Windows, the port will be COM followed by a number.

5) Now you’re ready to upload the sketch to the microcontroller.

On the Blink sketch, click the arrow pointing to the right:

[insert pic]

If the LED on the microcontroller is blinking, you successfully uploaded a sketch to your microcontroller from the Arduino IDE.

If not, do the following:

  1. Change the port under the tools menu
  2. Make sure the microcontroller is plugged into the computer
  3. Maybe your microcontroller does not have an LED attached to pin 13. This is standard on Arduino microcontrollers.
  4. If you are using a different microcontroller, check the specs to see if it has a built-in LED. Change the pin number from 13 in the Arduino Blink sketch to the number you need for your board.

Need some help?

Visit this Arduino How-To site for more help.

Going Further

Now that you’ve made a light blink imagine what else you could do if you could control sound with code! What types of sounds would you make? How would you make your instrument work? 

Share What You Learned

Share a short video of your microcontroller blinking