Sunday, March 19, 2017

Arduino: Part III: First Project Basics

Using the Arduino IDE -- a quick skinny overview:
  1. I have an Arduino Uno, have attached it to my PC via USB port, and opened that IDE:


  2. In the IDE, I navigate to Tools --> Boards --> Select the version of the Arduino being used:


  3. The Arduino IDE comes with some very basic code examples (aka, sketches.):

  4. The bare minimum of a code example will contain a method for "setup()" and an action method for "loop()"

  5. A very basic sketch to test your board is the "Blink" example.  Open this example.


  6. 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:   




  7. 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:

  8. avrdude: ser_open(): can't open device "\\.\COM3": The system cannot find the file specified.
    avrdude done.  Thank you.
    Problem uploading to board. 




  9. 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":



  10. To remedy this, I navigate back to the IDE, click Tools --> Ports --> and select "COM4" as my port.

  11. 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: verifying ...
avrdude: 928 bytes of flash verified
avrdude done.  Thank you.

No comments:

Post a Comment