Arduino - Environment

Arduino

Guide

Tutorials

Reference

Hardware

Software

Forum

Playground

Exhibition

Hacking

FAQ

Buy

Introduction | How To: Windows, Mac OS X, Linux; Arduino Mini, Arduino BT | Troubleshooting | Board | 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 (in Arduino 0005, pressing enter appends a newline to your text, this was removed in Arduino 0006). Choose the baud rate from the drop-down that matches the rate passed to Serial.begin in your sketch (in version of Arduino prior to 0006, the baud rate is specified in the Tools | Serial Monitor Baud Rate menu).

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

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

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

Microcontroller (MCU)

This menu lets you choose which microcontroller you're using; it should match the name (up to the dash) of the chip on your Arduino board (e.g. if your chip says "ATMEGA8-16PI", you would choose "atmega8"). Almost all Arduino boards use the atmega8, but the new Arduino stamps use the atmega168 (which can hold programs which are twice as big).

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.

Serial Monitor Baud Rate (Arduino 0005 and earlier)

This menu item controls the baud rate (speed) that the serial monitor uses to communicate with a sketch running on the Arduino board. It must match the value passed to in the code of the sketch. In Arduino 0006, this baud rate is set from a drop-down in the status bar when the serial monitor is enabled.

This baud rate does not affect the process of uploading sketches to the Arduino board; see the FAQ? if you need to change that.

Burn Bootloader

This burns the bootloader to your Arduino board, using an an AVR-ISP connected to the serial port selected in the Serial Port submenu. This only works with the atmega8 (not the atmega168). For more details see the bootloader page.

Burn Bootloader (parallel)

Windows and Linux only. Burns the bootloader to your Arduino board, using a parallel programmer. This only works with the atmega8 (not the atmega168).

### 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 preferences.txt file.

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