Arduino Ide
Arduino Ide
Writing Sketches
NB: Versions of the Arduino Software (IDE) prior to 1.0 saved sketches
with the extension .pde. It is possible to open these files with version
1.0, you will be prompted to save the sketch with the .ino extension on
save.
Note: If you are using an external programmer with your board, you
can hold down the "shift" key on your computer when using this
icon. The text will change to "Upload using Programmer"
New Creates a new sketch.
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.
File
New Creates a new instance of the editor, with the bare minimum
structure of a sketch already in place.
Open Allows to load a sketch file browsing through the computer
drives and folders.
Open Recent Provides a short list of the most recent sketches, ready
to be opened.
Save Saves the sketch with the current name. If the file hasn't been
named before, a name will be provided in a "Save as.." window.
Save as... Allows to save the current sketch with a different name.
Edit
Undo/Redo Goes back of one or more steps you did while editing;
when you go back, you may go forward with Redo.
Cut Removes the selected text from the editor and places it into the
clipboard.
Copy Duplicates the selected text in the editor and places it into the
clipboard.
Copy for Forum Copies the code of your sketch to the clipboard in a
form suitable for posting to the forum, complete with syntax
coloring.
Select All Selects and highlights the whole content of the editor.
Find Opens the Find and Replace window where you can specify
text to search inside the current sketch according to several
options.
Sketch
Upload Compiles and loads the binary file onto the configured board
through the configured Port.
Add File... Adds a supplemental file to the sketch (it will be copied
from its current location). The file is saved to the data subfolder of
the sketch, which is intended for assets such as documentation.
The contents of the data folder are not compiled, so they do not
become part of the sketch program.
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
inside curly braces are indented more.
Serial Monitor Opens the serial monitor window and initiates the
exchange of data with any connected board on the currently
selected Port. This usually resets the board, if the board supports
Reset over serial port opening.
Board Select the board that you're using. See below for descriptions
of the various boards .
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.
Help
Sketchbook
Beginning with version 1.0, files are saved with a .ino file extension.
Previous versions use the .pde extension. You may still open .pde
named files in version 1.0 and later, the software will automatically
rename the extension to .ino.
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 visible extension), C files (.c extension), C++ files (.cpp),
or header files (.h).
Before compiling the sketch, all the normal Arduino code files of
the sketch (.ino, .pde) are concatenated into a single file following
the order the tabs are shown in. The other file types are left as is.
Uploading
Before uploading your sketch, you need to select the correct items
from the Tools > Board and Tools > Port menus. The boards are
described below. On the Mac, the serial port is probably something
like /dev/tty.usbmodem241 (for an Uno or Mega2560 or Leonardo)
or /dev/tty.usbserial-1B1 (for a Duemilanove or earlier 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. On
Linux, it should be /dev/ttyACMx , /dev/ttyUSBx or similar. Once
you've selected the correct serial port and board, press the upload
button in the toolbar or select the Upload item from
the Sketch menu. Current Arduino boards will reset automatically
and begin the upload. With older boards (pre-Diecimila) that lack
auto-reset, you'll need to press the reset button on the board just
before starting the upload. On most boards, you'll see the RX and
TX LEDs blink as the sketch is uploaded. The Arduino Software
(IDE) will display a message when the upload is complete, or show
an error.
Libraries
Third-Party Hardware
Serial Monitor
This displays serial sent from the Arduino board over USB or serial
connector. 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 menu that matches the rate passed to Serial.begin in your
sketch. Note that on Windows, Mac or Linux the board will reset (it
will rerun your sketch) when you connect with the serial monitor.
Please note that the Serial Monitor does not process control
characters; if your sketch needs a complete management of the
serial communication with control characters, you can use an
external terminal program and connect it to the COM port assigned
to your Arduino board.
You can also talk to the board from Processing, Flash, MaxMSP, etc
(see the interfacing page for details).
Preferences
You can return the software to its default setting of selecting its
language based on your operating system by selecting System
Default from the Editor Language drop-down. This setting will take
effect when you restart the Arduino Software (IDE). Similarly, after
changing your operating system's settings, you must restart the
Arduino Software (IDE) to update it to the new default language.
Boards
The board selection has two effects: it sets the parameters (e.g.
CPU speed and baud rate) used when compiling and uploading
sketches; and sets 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. You can find a comparison table between the various
boards here.
Arduino Software (IDE) includes the built in support for the boards
in the following list, all based on the AVR Core. The Boards
Manager included in the standard installation allows to add support
for the growing number of new boards based on different cores like
Arduino Due, Arduino Zero, Edison, Galileo and so on.
Arduino Yún An ATmega32u4 running at 16 MHz with auto-reset, 12
Analog In, 20 Digital I/O and 7 PWM.