Now that we have the Arduino IDE installed, lets get familiar with it!
For this guide we will be using the Arduino Nano microcontroller. It’s a popular alternative model to the extremely popular Arduino Uno microcontroller. It has all the same features but it’s pins allow it to be easily attached onto a breadboard.
Arduino programs are commonly referred to as sketches, and in this tutorial we will learn to upload an example Blink sketch to our Arduino Nano board.
The Arduino IDE upon opening a new sketch.
Main Toolbar Buttons
On the IDE, we can see that there are many useful buttons on the toolbar such as:
Verify – checks your code for errors.
Upload – uploads the sketch to your Arduino board.
New – creates a new sketch.
Open – opens a new sketch.
Save – saves the current sketch.
Uploading the Blink Example Sketch
The Arduino IDE comes with many example sketches that work out of the box! Let’s open up and upload the most common one: the Blink sketch.
This can be done by going under File > Examples > 01.Basics > Blink
This will open the Blink sketch.
Make sure the board is connected and select the appropriate board model.
To do this: Select Tools > Board > Arduino AVR Boards > Arduino Nano
Now lets select the processor.
To do this: Select Processor> ATmega328P
Note: By the time you upload the sketch, if you are receiving errors about the processor, try each Tools > Processor menu option until your board gets properly programmed.
Now we’ll make sure that the Port of the Arduino Nano is selected.
To do this: Select Port > COM number of the Arduino Nano
Note: If there are many COM options and you are unsure which corresponds to your board, unplug all USB devices but leave your board connected. The only COM option that is left in the list will correspond to your board.
Now lets compile the code!
Press the compile button, and the message dialog in the bottom will say “Compiling sketch”.
Because the Blink sketch is a fresh-out-of-the-box working example, we should expect it to compile good and for the message dialog box to say “Done compiling” after a few seconds.
Time to finally upload the code.
Hit the Upload button and in a few seconds the sketch will finish uploading to the board!
Congrats! The Arduino Nano board should be blinking its onboard LED on/off.
You can use the steps above to upload other Arduino sketches to your board.