Arduino - Environment

Arduino

Buy | Download | Getting Started | Learning | Reference | Hardware | FAQ

Blog » | Forum » | Playground »

Guide Contents | Introduction | How To: Windows, Mac OS X, Linux; Arduino Nano, Arduino Mini, Arduino BT, LilyPad Arduino, Arduino Pro, Arduino Pro Mini; Xbee shield | Troubleshooting | Environment

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

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.

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.

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

Edit Page | Page History | Printable View | All Recent Site Changes