2013-12-09 10:45:24 +01:00
// Generate a manpage with: a2x -f manpage manpage.adoc
// or HTML with: a2x -f xhtml manpage.adoc
//
// This file uses {empty}:: in some places, to allow putting multiple
// paragraphs inside a single label list item. This is a bit ugly and
// non-semantic, but it seems this is the best way to do this. Asciidoc
// also supports putting a plus sign on a line by itself to join two
// paragraphs into a single list item. However, the indentation on the
// second paragraph makes that formatted with a fixed-size font.
// Removing the indentation completely makes the asciidoc source very
// unreadable. Also, for the --board option, there is a a paragraph,
// followed by a list, followed by another paragraph. The + approach can
// only put the latter paragraph into the inner list, not the outer
// one...
ARDUINO(1)
==========
:doctype: manpage
NAME
----
arduino - Integrated development environment for Arduino boards
SYNOPSIS
--------
*arduino* ['FILE.ino'...]
2015-04-15 11:00:01 +02:00
*arduino* [*--verify*|*--upload*] [*--board* __package__:__arch__:__board__[:__parameters__]] [*--port* __portname__] [*--pref* __name__=__value__] [*-v*|*--verbose*] [--preserve-temp-files] [__FILE.ino__]
2013-12-09 10:45:24 +01:00
2015-05-29 15:15:08 +02:00
*arduino* [*--get-pref* [__preference__]]
2015-04-09 10:48:44 +02:00
2015-04-09 13:03:41 +02:00
*arduino* [*--install-boards* __package name__:__platform architecture__[:__version__]]
2015-04-09 10:48:44 +02:00
2015-04-09 15:34:34 +02:00
*arduino* [*--install-library* __library name__[:__version__][,__library name__[:__version__],__library name__[:__version__]]
2015-04-09 10:48:44 +02:00
2013-12-09 10:45:24 +01:00
DESCRIPTION
-----------
The 'arduino' integrated development environment allows editing,
compiling and uploading sketches (programs) for Arduino
(and compatible) microcontroller boards.
Normally, running the arduino command starts the IDE, optionally loading
any .ino files specified on the commandline.
2014-08-22 15:39:33 +02:00
Alternatively, if any of the following command line options is given, no graphical
2013-12-09 10:45:24 +01:00
interface will be shown and instead a one-off verify (compile) or upload
will be done. A single .ino file should be given. If the sketch contains
multiple .ino files, any one can be specified on the commandline, but
the entire sketch will be compiled.
When running in a one-off mode, it might be useful to set the
*build.path* preference to allow keeping intermediate build results
between multiple runs and only recompile the files that changed.
Note that on MacOS X, the main executable is
2015-06-24 00:03:16 +02:00
'Arduino.app/Contents/MacOS/Arduino' instead of 'arduino'.
2013-12-09 10:45:24 +01:00
2015-04-09 10:48:44 +02:00
ACTIONS
*--verify*::
Build the sketch.
*--upload*::
Build and upload the sketch.
2015-05-29 15:15:08 +02:00
*--get-pref* [__preference__]::
2015-04-09 10:48:44 +02:00
Prints the value of the given preference to the standard output
stream. When the value does not exist, nothing is printed and
the exit status is set (see EXIT STATUS below).
2015-05-29 15:15:08 +02:00
If no preference is given as parameter, it prints all preferences.
2015-04-09 10:48:44 +02:00
2015-04-09 13:03:41 +02:00
*--install-boards* __package name__:__platform architecture__[:__version__]::
2015-04-09 10:48:44 +02:00
Fetches available board support (platform) list and install the specified one, along with its related tools. If __version__ is omitted, the latest is installed. If a platform with the same version is already installed, nothing is installed and program exits with exit code 1. If a platform with a different version is already installed, it's replaced.
*--install-library* __library name__[:__version__]::
Fetches available libraries list and install the specified one. If __version__ is omitted, the latest is installed. If a library with the same version is already installed, nothing is installed and program exits with exit code 1. If a library with a different version is already installed, it's replaced.
2015-04-09 15:34:34 +02:00
Multiple libraries can be specified, separated by a comma.
2015-04-09 10:48:44 +02:00
2013-12-09 10:45:24 +01:00
OPTIONS
-------
*--board* __package__:__arch__:__board__[:__parameters__]::
Select the board to compile for.
* __package__ is the identifier of the vendor (the first
level folders inside the 'hardware' directory). Default
arduino boards use 'arduino'.
* __architecture__ is the architecture of the board (second level folders
inside the 'hardware' directory). Default arduino boards use
either *arduino:avr* for all AVR-based boards (like Uno, Mega
or Leonardo) or *arduino:sam* for 32bit SAM-based boards
(like Arduino Due).
* __board__ is the actual board to use, as defined in 'boards.txt'
contained in the architecture folder selected. For example,
*arduino:avr:uno* for the Arduino Uno,
*arduino:avr:diecimila* for the Arduino Duemilanove or
Diecimila, or *arduino:avr:mega* for the Arduino Mega.
* __parameters__ is a comma-separated list of boards specific parameters
that are normally shown under submenus of the "Tools" menu. For
example *arduino:avr:nano:cpu=atmega168* to Select the mega168
variant of the Arduino Nano board.
{empty}::
If this option is not passed, the value from the current
preferences is used (e.g., the last board selected in the IDE).
*--port* __portname__::
Select the serial port to perform upload of the sketch.
On linux and MacOS X, this should be the path to a device file (e.g.,
*/dev/ttyACM0*). On Windows, this should be the name of the serial
port (e.g., *COM3*).
{empty}::
If this option is not passed, the value from the current
preferences is used (e.g., the last port selected in the IDE).
2014-02-06 13:34:33 +01:00
*--verbose-build*::
2014-04-07 11:26:29 +02:00
Enable verbose mode during build. If this option is not given,
2014-08-22 15:39:33 +02:00
verbose mode during build is *disabled* regardless of the current
2014-04-07 11:26:29 +02:00
preferences.
2014-02-06 13:34:33 +01:00
2015-04-15 11:00:01 +02:00
*--preserve-temp-files*::
Keep temporary files (preprocessed sketch, object files...) after termination.
If omitted, temporary files are deleted.
2014-04-07 11:47:04 +02:00
{empty}::
This option is only valid together with *--verify* or
*--upload*.
2014-02-06 13:34:33 +01:00
*--verbose-upload*::
2014-04-07 11:26:29 +02:00
Enable verbose mode during upload. If this option is not given,
2014-08-22 15:39:33 +02:00
verbose mode during upload is *disabled* regardless of the current
2014-04-07 11:26:29 +02:00
preferences.
2013-12-09 10:45:24 +01:00
2014-04-07 11:47:04 +02:00
{empty}::
This option is only valid together with *--verify* or
*--upload*.
2014-02-06 13:34:33 +01:00
*-v, --verbose*::
Enable verbose mode during build and upload.
2014-04-07 11:26:29 +02:00
This option has the same effect of using both *--verbose-build*
and *--verbose-upload*.
2013-12-09 10:45:24 +01:00
2014-04-07 11:47:04 +02:00
{empty}::
This option is only valid together with *--verify* or
*--upload*.
2014-01-25 23:29:35 +01:00
*--preferences-file* __filename__::
Read and store preferences from the specified __filename__ instead
of the default one.
2013-12-09 10:45:24 +01:00
*--pref* __name__=__value__::
Sets the preference __name__ to the given __value__.
{empty}::
Note that the preferences you set with this option are not
validated: Invalid names will be set but never used, invalid
values might lead to an error later on.
2014-08-22 15:39:33 +02:00
*--save-prefs*::
Save any (changed) preferences to *preferences.txt*. In particular
*--board*, *--port*, *--pref*, *--verbose*, *--verbose-build* and
*--verbose-upload* may alter the current preferences.
Process some commandline arguments earlier
Previously, the --board and --port arguments were stored in a variable
first and only processed later. Now, the arguments are processed right
away.
This does mean that the arguments are processed when the GUI is not yet
initialized, which caused problems with calling onBoardOrPortChange and
friends from selectBoard. However, since the GUI is not initialized,
there is no real reason to call them either - if we just set the
preferences to the right values, the GUI will be initialized correctly
later. For this reason, selectBoard no longer calls the GUI update
methods. Instead, those are called from the GUI code when the board is
changed through the menu instead (e.g., after calling selectBoard).
This commit slightly changes behaviour. Previously, --board and --port
only worked in combination with --verify and --upload, but were ignored
when just starting the IDE. Now, these are processed regardless of the
other options present.
Additionally, this commit causes all changed preferences to be saved.
Previously, only changes with --pref were saved, --board and --port
options were only active for the current run. This was caused because
the saving of the preferences happened as a side effect of loading the
file in the Editor, but only the --pref option was processed at that
time.
Note that the --verbose options are still only active for the current
run and are only valid combined with --verify or --upload (since they
default to non-verbose instead of the current preference).
2014-04-07 10:27:39 +02:00
2013-12-09 10:45:24 +01:00
PREFERENCES
-----------
Arduino keeps a list of preferences, as simple name and value pairs.
Below, a few of them are documented but a lot more are available.
*sketchbook.path*::
The path where sketches are (usually) stored. This path can also
contain some special subdirectories (see FILES below).
*update.check*::
When set to true, the IDE checks for a new version on startup.
*editor.external*::
When set to true, use an external editor (the IDE does not allow
editing and reloads each file before verifying).
*build.path*::
The path to use for building. This is where things like the
preprocessed .cpp file, compiled .o files and the final .hex
file go.
{empty}::
If set, this directory should already exist before running the
arduino command.
{empty}::
If this preference is not set (which is normally the case), a
new temporary build folder is created on every run and deleted
again when the application is closed.
EXIT STATUS
-----------
*0*:: Success
*1*:: Build failed or upload failed
*2*:: Sketch not found
*3*:: Invalid (argument for) commandline option
2014-04-07 12:19:22 +02:00
*4*:: Preference passed to *--get-pref* does not exist
2013-12-09 10:45:24 +01:00
FILES
-----
*~/.arduino15/preferences.txt*::
This file stores the preferences used for the IDE, building and
uploading sketches.
*My Documents/Arduino/* (Windows)::
*~/Documents/Arduino/* (Mac OS X)::
*~/Arduino/* (Linux)::
This directory is referred to as the "Sketchbook" and contains
the user's sketches. The path can be changed through the
*sketchbook.path* preference.
{empty}::
Apart from sketches, three special directories can be inside the
sketchbook:
*libraries*:::
Libraries can be put inside this directory, one library
per subdirectory.
*hardware*:::
Support for third-party hardware can be added through
this directory.
*tools*:::
External code-processing tools (that can be run through
the Tools menu of the IDE) can be added here.
EXAMPLES
--------
Start the Arduino IDE, with two files open:
arduino /path/to/sketch/sketch.ino /path/to/sketch/extra.ino
Compile and upload a sketch using the last selected board and serial port
arduino --upload /path/to/sketch/sketch.ino
Compile and upload a sketch to an Arduino Nano, with an Atmega168 CPU,
connected on port '/dev/ttyACM0':
arduino --board arduino:avr:nano:cpu=atmega168 --port /dev/ttyACM0 --upload /path/to/sketch/sketch.ino
Compile a sketch, put the build results in the 'build' directory an
re-use any previous build results in that directory.
arduino --pref build.path=/path/to/sketch/build --verify /path/to/sketch/sketch.ino
2014-04-07 12:01:54 +02:00
Change the selected board and build path and do nothing else.
2014-08-22 15:39:33 +02:00
arduino --pref build.path=/path/to/sketch/build --board arduino:avr:uno --save-prefs
2014-04-07 12:01:54 +02:00
2015-04-09 10:48:44 +02:00
Install latest SAM board support
2015-04-09 13:03:41 +02:00
arduino --install-boards "arduino:sam"
Install AVR board support, 1.6.2
arduino --install-boards "arduino:avr:1.6.2"
2015-04-09 10:48:44 +02:00
Install Bridge library version 1.0.0
arduino --install-library "Bridge:1.0.0"
2015-04-09 15:34:34 +02:00
Install Bridge and Servo libraries
arduino --install-library "Bridge:1.0.0,Servo:1.2.0"
2015-04-30 16:44:24 +02:00
BUGS
----
Even in command line mode the Arduino IDE requires a graphical user interface to be
present. This should usually be the case in Windows or Mac OS X. On Linux however you
might want to compile and upload sketches when logged in via SSH or in batch mode. To
accomplish this, install the Xvfb dummy X server and write a small wrapper script to
create an instance of this Xserver, run the Arduino IDE in it and kill the Xserver
afterwards:
#!/bin/bash
Xvfb :1 -nolisten tcp -screen :1 1280x800x24 &
xvfb="$!"
DISPLAY=:1 arduino $@
kill -9 $xvfb
Save the script as *arduino-headless* and run it with the options described above.
If the script does not return to a shell prompt, the options you specified were wrong
and the Arduino IDE actually opened a window, stop its execution with Ctrl+C.
2014-04-07 11:14:08 +02:00
HISTORY
-------
1.5.2::
Added initial commandline support. This introduced *--verify*,
*--upload*, *--board*, *--port*, *--verbose* and *-v*.
1.5.5::
Added support for board-specific parameters to *--board*.
{empty}::
Sketch filenames are now interpreted relative to the current
directory instead of the location of the arduino command itself.
1.5.6::
Introduced *--pref*, *--preferences-file*, *--verbose-build* and
*--verbose-upload*.
{empty}::
Preferences set through --pref are remembered, preferences set
through *--board*, *--port* or the *--verbose* options are not.
{empty}::
When running with *--verify* or *--upload*, the full GUI is no
longer shown. Error messages still use a graphical popup and on
Windows, the splash screen is still shown.
2014-08-22 15:39:33 +02:00
1.5.8::
Introduced *--save-prefs*.
2015-06-24 00:03:16 +02:00
1.6.2::
Main executable in MacOS X changed from
'Arduino.app/Contents/MacOS/JavaApplicationStub' to
'Arduino.app/Contents/MacOS/Arduino'.
2014-04-07 10:40:45 +02:00
2015-04-09 10:48:44 +02:00
1.6.4::
2015-04-09 13:03:41 +02:00
Introduced *--install-boards* and *--install-library*.
2015-04-09 10:48:44 +02:00
2014-04-07 10:40:45 +02:00
{empty}::
2014-08-22 15:39:33 +02:00
*--pref* options are now not saved to the preferences file, just
like *--board* and *--port*, unless *--save-prefs* is specified.
Process some commandline arguments earlier
Previously, the --board and --port arguments were stored in a variable
first and only processed later. Now, the arguments are processed right
away.
This does mean that the arguments are processed when the GUI is not yet
initialized, which caused problems with calling onBoardOrPortChange and
friends from selectBoard. However, since the GUI is not initialized,
there is no real reason to call them either - if we just set the
preferences to the right values, the GUI will be initialized correctly
later. For this reason, selectBoard no longer calls the GUI update
methods. Instead, those are called from the GUI code when the board is
changed through the menu instead (e.g., after calling selectBoard).
This commit slightly changes behaviour. Previously, --board and --port
only worked in combination with --verify and --upload, but were ignored
when just starting the IDE. Now, these are processed regardless of the
other options present.
Additionally, this commit causes all changed preferences to be saved.
Previously, only changes with --pref were saved, --board and --port
options were only active for the current run. This was caused because
the saving of the preferences happened as a side effect of loading the
file in the Editor, but only the --pref option was processed at that
time.
Note that the --verbose options are still only active for the current
run and are only valid combined with --verify or --upload (since they
default to non-verbose instead of the current preference).
2014-04-07 10:27:39 +02:00
2014-04-09 22:33:53 +02:00
{empty}::
A path passed to *--preferences-file*, or set in the
*build.path*, *preferences.path* or *settings.path* is now
interpreted relative to the current directory instead of the
location of the arduino command itself.
2013-12-09 10:45:24 +01:00
RESOURCES
---------
2015-05-20 17:10:06 +02:00
Web site: <http://www.arduino.cc/>
2013-12-09 10:45:24 +01:00
Help on projects and programming: <http://forum.arduino.cc/>
Report bugs: <http://github.com/arduino/Arduino/issues>
IDE and framework development mailing list: <https://groups.google.com/a/arduino.cc/forum/#!forum/developers>