Introduction to the Arduino Environment

Toolbar

Verify/Compile

Checks your code for errors.

Stop

Stops the serial monitor, or unhighlight other buttons.

New

Creates a new sketch.

Open

Presents a menu of all the sketches in your sketchbook. Note: due to a bug in Java, this menu doesn't scroll; if you need to open a sketch late in the list, use the File | Sketchbook menu instead.

Save

Saves your sketch.

Upload to I/O Board

Uploads your code to the Arduino I/O board. Make sure to save or verify your sketch before uploading it.

Serial Monitor

Displays serial data being sent from the Arduino board (USB or serial board). To send data to the board, enter text and click on the "send" button or press enter. Choose the baud rate from the drop-down that matches the rate passed to Serial.begin in your sketch. Note that on Mac or Linux, the Arduino board will reset (rerun your sketch from the beginning) when you connect with the serial monitor.

You can also talk to the board from Processing, Flash, MaxMSP, etc (see the interfacing page for details).

Tab Menu

Allows you to manage sketches with more than one file (each of which appears in its own tab). These can be normal Arduino code files (no extension), C files (.c extension), C++ files (.cpp), or header files (.h). See the description of the build process for details of how these are handled.

Menus

Sketch

Verify/Compile

Checks your sketch for errors.

Import Library

Uses a library in your sketch. Works by adding #includes to the top of your code. This makes extra functionality available to your sketch, but increases its size. To stop using a library, delete the appropriate #includes from the top of your sketch. For more details, see the page on Libraries.

Show Sketch Folder

Opens the sketch folder on the desktop.

Add File...

Adds another source file to the sketch. The new file appears in a new tab in the sketch window. This facilitates and larger projects with multiple source files. Files can be removed from a sketch using the tab menu.

Tools

Auto Format

This formats your code nicely: i.e. indents it so that opening and closing curly braces line up, and that the statements instead curly braces are indented more.

Copy for Discourse

Copies the code of your sketch to the clipboard in a forum suitable for posting to the forum, complete with syntax coloring.

Copy as HTML

Copies the code of your sketch to the clipboard as HTML, suitable for embedding in web pages.

Board

Select the board that you're using. This controls the way that your sketch is compiled and uploaded as well as the behavior of the Burn Bootloader menu items. See below for details.

Serial Port

This menu contains all the serial devices (real or virtual) on your machine. It should automatically refresh every time you open the top-level tools menu.

Before uploading your sketch, you need to select the item from this menu that represents your Arduino board. On the Mac, this is probably something like /dev/tty.usbserial-1B1 (for a USB board), or /dev/tty.USA19QW1b1P1.1 (for a serial board connected with a Keyspan USB-to-Serial adapter). On Windows, it's probably COM1 or COM2 (for a serial board) or COM4, COM5, COM7, or higher (for a USB board) - to find out, you look for USB serial device in the ports section of the Windows Device Manager.

Burn Bootloader

The items in this menu allow you to burn a bootloader onto your board with a variety of programmers. This is not required for normal use of an Arduino board, but may be useful if you purchase additional ATmega's or are building a board yourself. Ensure that you've selected the correct board from the Boards menu beforehand. To burn a bootloader with the AVR ISP, you need to select the item corresponding to your programmer from the Serial Port menu. Instructions are available for building a parallel programmer.

Board Descriptions

The board selection has two effects: the parameters (e.g. CPU speed and baud rate) used when compiling and uploading sketches; and the file and fuse settings used by the burn bootloader command. Some of the board definitions differ only in the latter, so even if you've been uploading successfully with a particular selection you'll want to check it before burning the bootloader.

Arduino Duemilanove w/ ATmega328

An ATmega328 running at 16 MHz with auto-reset. Also used for the 16 MHz (5V) versions of the Arduino Pro or Pro Mini with an ATmega328.

Arduino Diecimila or Duemilanove w/ ATmega168

An ATmega168 running at 16 MHz with auto-reset. Compilation and upload is equivalent to Arduino NG or older w/ ATmega168, but the bootloader burned has a faster timeout (and blinks the pin 13 LED only once on reset). Also used for the 16 MHz (5V) versions of the Arduino Pro and Pro Mini with an ATmega168.

Arduino Mega

An ATmega1280 running at 16 MHz with auto-reset.

Arduino Mini

Equivalent to Arduino NG or older w/ ATmega168 (i.e. an ATmega168 running at 16 MHz without auto-reset).

Arduino Nano

Equivalent to Arduino Diecimila or Duemilanove w/ ATmega168 (i.e. an ATmega168 running at 16 MHz with auto-reset).

Arduino BT

ATmega168 running at 16 MHz. The bootloader burned includes codes to initialize the on-board bluetooth module.

LilyPad Arduino w/ ATmega328

An ATmega328 running at 8 MHz (3.3V) with auto-reset. Equivalent to Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328.

LilyPad Arduino w/ ATmega168

An ATmega168 running at 8 MHz. Compilation and upload is equivalent to the Arduino Pro or Pro Mini (8 MHz) w/ ATmega168. The bootloader burned, however, has a slower timeout (and blinks the pin 13 LED three times on reset) because the original versions of the LilyPad didn't support auto-reset. They also didn't include an external clock, so the burn bootloader command configures the fuses of ATmega168 for an internal 8 MHz clock.

If you have a recent version of the LilyPad, (w/ a 6-pin programming header), you'll want to select Arduino Pro or Pro Mini (8 MHz) w/ ATmega168 before burning the bootloader.

Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328

An ATmega328 running at 8 MHz (3.3V) with auto-reset. Equivalent to LilyPad Arduino w/ ATmega328.

Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega168

An ATmega168 running at 8 MHz (3.3V) with auto-reset.

Arduino NG or older w/ ATmega168

An ATmega168 running at 16 MHz without auto-reset. Compilation and upload is equivalent to Arduino Diecimila or Duemilanove w/ ATmega168, but the bootloader burned has a slower timeout (and blinks the pin 13 LED three times on reset).

Arduino NG or older w/ ATmega8

An ATmega8 running at 16 MHz without auto-reset.

Preferences

Some preferences can be set in the preferences dialog (found under the Arduino menu on the Mac, or File on Windows and Linux). The rest can be found in the preference files.

The text of the Arduino getting started guide is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the guide are released into the public domain.