OK don't forget - you have to get though the Lesson #0 steps to install drivers, software, and verify that your Arduino is powered, has the bootloader installed and shows upwards as a COM/Series port... Don't proceed unless that has been done!

Startup!

Double click the Arduino software icon on your desktop

arduino_icon.png

To open upwards the workspace, also called the IDE. IDE stands for Integrated Development Eastnvironment. Basically, a give-and-take processor for writing code. The full proper name is really a mouthfull, so we say I.D.Due east. (Centre Dee Eee)

Anyhow, it looks like this:

arduino_ide.png

The main IDE window has multiple tabs and areas, nosotros'll visit all of these presently, so keep your heart on this diagram!

arduino_ide-parts.png

Getting Ready To Practise This Thing!

We're going to jump right in! Before yous can run a program on the Arduino you need to tell the IDE where to detect it and what kind you lot're going to be programming (as we mentioned in lesson #0 there are dozens of types of Arduinos!)

Select Board Type Arduino UNO

Under the Tools menu, discover the Board submenu and navigate that to select Arduino (Genuino) UNO.

You should use this lath selection also if you lot are using an Adafruit Metro or whatsoever other Arduino UNO compatible

arduino_selectuno.png

Select Correct Serial Port

Most important you will also need to select the correct Series port. This is where people tin can go tripped upwards. The adept news is if you have a genuine Arduino UNO, the name will appear next to the serial port menu item to arrive like shooting fish in a barrel to pick out!

arduino_selectCOM.png

arduino_Screen_Shot_2016-07-19_at_9.05.32_PM.png

If you have an Arduino compatible like Adafruit Metro, y'all may not see annihilation after the Serial port name, but it will still be the just choice available that is non COM1 or something with Bluetooth in the name

arduino_metro.png

~~ Hints! ~~

Windows: It will never exist COM1 don't pick that one. Y'all should only accept 1 other pick.

Mac OS Ten and Linux: It will never be an option with 'bluetooth'  in the name, look for /dev/cu.usbmodem or /dev/cu.usbserial or /dev/ttyUSB or similar!

Have lots of Serial ports? Try unplugging your Arduino and seeing which port disappears side by side fourth dimension you look at the Ports listing!

The lath and serial port preferences are saved so y'all only have to set information technology one time, the plan will remember next fourth dimension it's run.

Notwithstanding, if you take multiple Arduino's, they may be assigned difference COM ports. So every fourth dimension you plug in a new Arduino, double check that the correct port and type is selected!

Open up Glimmer Sketch

Sketches are little scripts that you lot tin transport to the Arduino to tell information technology how to human activity. Let's open up an Case Sketch. Go to the File bill of fare -> Examples -> 01.Basics -> Glimmer

arduino_blinksketch.png

This should open up a new window that should now look like this, with a bunch of text in the eye white infinite. In a higher place the text is a tab labeled Blink

arduino_blinkopened.png

Verify / Compile

Allow's keep going! The first stride to getting a Sketch set up for transfer over to the arduino is to Verify/Compile it. That ways bank check information technology over for mistakes (sort of like spell-checking or grammatical editing) and and so translate information technology into an app that is uniform with the Arduino hardware.

Verify: Like having a friend look over your homework essay earlier handing it in, verifying means the Arduino software will cheque over and await for typos, common errors - it can't take hold of all errors, just like a spellcheck wont exist able to tell that you spelled "bear" like "bare" by accident since both are proper words

Compile: check your music player and yous'll probably find you lot own at least i compilation, which means a collection that someone put together in a specific order. When Arduino compiles your sketch, it is putting/arranging it together into the right society for your Arduino hardware board to be able to run

While in theory you could have Arduino do each one separately, information technology's faster to just take information technology do both at the same time

You can first the action via the Sketch menu

arduino_verifycompile.png

After a few seconds, you lot should encounter the bulletin Done compiling. in the Condition Bar and Sketch uses ... bytes (ten%) of program storage space (or something similar) in the Program Notification Area.

This means the sketch was well-written and is ready for uploading to the Arduino board!

arduino_compiled.png

Upload

Ready for the moment of truth? Now information technology's time to upload your very starting time sketch. Make sure the Arduino is plugged in, the green low-cal is on and the right lath and Serial Port is selected.

Select Upload from the Sketch menu

arduino_upload.png

Later a few seconds you should get this screen, with the bulletin Done uploading. in the status bar.

arduino_doneuploading.png

Things That Tin can Go Wrong...

Arduino bootloader doesn't reply

If you get the post-obit mistake message avrdude: stk500_getsync(): non in sync or avrdude: stk500_recv(): programmer is non responding that means that the Arduino bootloader is not responding

arduino_stk500err.png

This fault tin be caused past a lot of issues. Check the post-obit:

  • Is the correct Arduino Lath selected?
  • Is the correct Series Port selected?
  • Is the correct driver installed?
  • Is something continued to the Reset pin or pressing the reset button?
  • Try disconnecting all continued shields, jumper wires and components
  • Is the bit inserted into the Arduino properly? (If you congenital your own arduino or have burned the bootloader on yourself)
  • Does the chip accept the correct bootloader on it? (If you congenital your own arduino or have burned the bootloader on yourself)

You lot can likewise check Lesson #0 on how to verify if the bootloader is installed

Can't open serial port device

If y'all get an error like avrdude: ser_open(): can't open up device it likely means your Arduino got disconnected from USB somehow

arduino_cantopendevice.png

This error can be caused by a few possible issues. Check the following:

  • Is the right Serial Port selected?
  • Is the correct driver installed?
  • Try unplugging/replugging the USB cable
  • Try another USB cable or USB port
  • Your estimator's USB system may have crashed. Shutdown your computer, disconnect power, await 3 minutes and so restart information technology

Video of all steps

Here is a video showing the timing of the steps described so far, opening the Blink sketch and setting the board and serial port.

Sentinel!

If you have a UNO Arduino, the upload process is quite fast: Once you click Upload from the software the IDE will ask the Arduino to reset itself into the bootloader and immediately start uploading the glimmer sketch. After uploading, the sketch is chop-chop verified - the IDE asks the Arduino 'please repeat back what I just asked to you to do' - and reset again to showtime running the sketch.

The niggling translucent L LED will get-go blinking on and off, a 2d on and a second off.

Here's a looping animation showing upload and then three blinks: notice the RX and TX LEDs blink during upload, but it happens very fast!

This guide was starting time published on Sep 01, 2016. It was last updated on Sep 01, 2016.

This page (Upload Your Commencement Sketch) was last updated on April ten, 2022.

Text editor powered past tinymce.