Using the Arduino IDE — a quick skinny overview:
- I have an Arduino Uno, have attached it to my PC via USB port, and opened that IDE:
- In the IDE, I navigate to Tools –> Boards –> Select the version of the Arduino being used:
- The Arduino IDE comes with some very basic code examples (aka, sketches.):
- The bare minimum of a code example will contain a method for “setup()” and an action method for “loop()”
- A very basic sketch to test your board is the “Blink” example. Open this example.
- In the top left corner of the application, click the checkmark icon to compile the code and if there are no errors you will see similar to the following:
- Now you can upload the code to the Arduino by “Arrow” icon. This is a common problem I run into where my Arduino is not registering on the proper port:
- If you click on the “Magnifying glass” icon or navigate to Tools –> Serial Monitor –> click to open an interface that shows communications to the Arduino. In my scenario, the IDE is looking to “COM3” to find my Arduino. If I open Windows Device Manager, I can see that it is registering on port “COM4”:
- To remedy this, I navigate back to the IDE, click Tools –> Ports –> and select “COM4” as my port.
- If you don’t have the above, or any other error, when you upload your code, you should see the following result and will notice that the Arduino now has the blinking light that you programmed.
avrdude: ser_open(): can’t open device “\.COM3”: The system cannot find the file specified.
avrdude done. Thank you.
Problem uploading to board.
avrdude: verifying …
avrdude: 928 bytes of flash verified
avrdude done. Thank you.