| 1 |
// Generate a manpage with: a2x -f manpage manpage.adoc |
| 2 |
// or HTML with: a2x -f xhtml manpage.adoc |
| 3 |
// |
| 4 |
// This file uses {empty}:: in some places, to allow putting multiple |
| 5 |
// paragraphs inside a single label list item. This is a bit ugly and |
| 6 |
// non-semantic, but it seems this is the best way to do this. Asciidoc |
| 7 |
// also supports putting a plus sign on a line by itself to join two |
| 8 |
// paragraphs into a single list item. However, the indentation on the |
| 9 |
// second paragraph makes that formatted with a fixed-size font. |
| 10 |
// Removing the indentation completely makes the asciidoc source very |
| 11 |
// unreadable. Also, for the --board option, there is a a paragraph, |
| 12 |
// followed by a list, followed by another paragraph. The + approach can |
| 13 |
// only put the latter paragraph into the inner list, not the outer |
| 14 |
// one... |
| 15 |
|
| 16 |
ARDUINO(1) |
| 17 |
========== |
| 18 |
:doctype: manpage |
| 19 |
|
| 20 |
NAME |
| 21 |
---- |
| 22 |
arduino - Integrated development environment for Arduino boards |
| 23 |
|
| 24 |
SYNOPSIS |
| 25 |
-------- |
| 26 |
*arduino* ['FILE.ino'...] |
| 27 |
|
| 28 |
*arduino* [*--verify*|*--upload*] [*--board* __package__:__arch__:__board__[:__parameters__]] [*--port* __portname__] [*--pref* __name__=__value__] [*-v*|*--verbose*] [*--preserve-temp-files*] [__FILE.ino__] |
| 29 |
|
| 30 |
*arduino* [*--get-pref* [__preference__]] |
| 31 |
|
| 32 |
*arduino* [*--install-boards* __package name__:__platform architecture__[:__version__]] |
| 33 |
|
| 34 |
*arduino* [*--install-library* __library name__[:__version__][,__library name__[:__version__],__library name__[:__version__]] |
| 35 |
|
| 36 |
*arduino* [*--version*] |
| 37 |
|
| 38 |
DESCRIPTION |
| 39 |
----------- |
| 40 |
The 'arduino' integrated development environment allows editing, |
| 41 |
compiling and uploading sketches (programs) for Arduino |
| 42 |
(and compatible) microcontroller boards. |
| 43 |
|
| 44 |
Normally, running the arduino command starts the IDE, optionally loading |
| 45 |
any .ino files specified on the commandline. |
| 46 |
|
| 47 |
Alternatively, if any of the following command line options is given, no graphical |
| 48 |
interface will be shown and instead a one-off verify (compile) or upload |
| 49 |
will be done. A single .ino file should be given. If the sketch contains |
| 50 |
multiple .ino files, any one can be specified on the commandline, but |
| 51 |
the entire sketch will be compiled. |
| 52 |
|
| 53 |
When running in a one-off mode, it might be useful to set the |
| 54 |
*build.path* preference to allow keeping intermediate build results |
| 55 |
between multiple runs and only recompile the files that changed. |
| 56 |
|
| 57 |
Note that on MacOS X, the main executable is |
| 58 |
'Arduino.app/Contents/MacOS/Arduino' instead of 'arduino'. |
| 59 |
|
| 60 |
Note that on Windows, due to the diffence between GUI and console apps, that the |
| 61 |
'arduino_debug.exe' is the appropriate executable to use if you want to use the majority |
| 62 |
of these command line options. The 'arduino.exe' GUI version of the launcher **may** perform |
| 63 |
some of the functions described below, but will not output any messages to the console, |
| 64 |
meaning it is pretty useless if you want any feedback or to be able to keep log files for |
| 65 |
automated testing, etc. |
| 66 |
|
| 67 |
ACTIONS |
| 68 |
|
| 69 |
*--verify*:: |
| 70 |
Build the sketch. |
| 71 |
|
| 72 |
*--upload*:: |
| 73 |
Build and upload the sketch. |
| 74 |
|
| 75 |
*--get-pref* [__preference__]:: |
| 76 |
Prints the value of the given preference to the standard output |
| 77 |
stream. When the value does not exist, nothing is printed and |
| 78 |
the exit status is set (see EXIT STATUS below). |
| 79 |
If no preference is given as parameter, it prints all preferences. |
| 80 |
|
| 81 |
*--install-boards* __package name__:__platform architecture__[:__version__]:: |
| 82 |
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. |
| 83 |
|
| 84 |
*--install-library* __library name__[:__version__]:: |
| 85 |
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. |
| 86 |
Multiple libraries can be specified, separated by a comma. |
| 87 |
|
| 88 |
*--version*:: |
| 89 |
Print the version information and exit. |
| 90 |
|
| 91 |
OPTIONS |
| 92 |
------- |
| 93 |
*--board* __package__:__arch__:__board__[:__parameters__]:: |
| 94 |
Select the board to compile for. |
| 95 |
|
| 96 |
* __package__ is the identifier of the vendor (the first |
| 97 |
level folders inside the 'hardware' directory). Default |
| 98 |
arduino boards use 'arduino'. |
| 99 |
* __architecture__ is the architecture of the board (second level folders |
| 100 |
inside the 'hardware' directory). Default arduino boards use |
| 101 |
either *arduino:avr* for all AVR-based boards (like Uno, Mega |
| 102 |
or Leonardo) or *arduino:sam* for 32bit SAM-based boards |
| 103 |
(like Arduino Due). |
| 104 |
* __board__ is the actual board to use, as defined in 'boards.txt' |
| 105 |
contained in the architecture folder selected. For example, |
| 106 |
*arduino:avr:uno* for the Arduino Uno, |
| 107 |
*arduino:avr:diecimila* for the Arduino Duemilanove or |
| 108 |
Diecimila, or *arduino:avr:mega* for the Arduino Mega. |
| 109 |
* __parameters__ is a comma-separated list of boards specific parameters |
| 110 |
that are normally shown under submenus of the "Tools" menu. For |
| 111 |
example *arduino:avr:nano:cpu=atmega168* to Select the mega168 |
| 112 |
variant of the Arduino Nano board. |
| 113 |
|
| 114 |
{empty}:: |
| 115 |
If this option is not passed, the value from the current |
| 116 |
preferences is used (e.g., the last board selected in the IDE). |
| 117 |
|
| 118 |
*--port* __portname__:: |
| 119 |
Select the serial port to perform upload of the sketch. |
| 120 |
On linux and MacOS X, this should be the path to a device file (e.g., |
| 121 |
*/dev/ttyACM0*). On Windows, this should be the name of the serial |
| 122 |
port (e.g., *COM3*). |
| 123 |
|
| 124 |
{empty}:: |
| 125 |
If this option is not passed, the value from the current |
| 126 |
preferences is used (e.g., the last port selected in the IDE). |
| 127 |
|
| 128 |
*--verbose-build*:: |
| 129 |
Enable verbose mode during build. If this option is not given, |
| 130 |
verbose mode during build is *disabled* regardless of the current |
| 131 |
preferences. |
| 132 |
|
| 133 |
*--preserve-temp-files*:: |
| 134 |
Keep temporary files (preprocessed sketch, object files...) after termination. |
| 135 |
If omitted, temporary files are deleted. |
| 136 |
|
| 137 |
{empty}:: |
| 138 |
This option is only valid together with *--verify* or |
| 139 |
*--upload*. |
| 140 |
|
| 141 |
*--useprogrammer*:: |
| 142 |
Upload using a programmer. Set if you're using an external programmer, or |
| 143 |
using the Arduino as ISP. |
| 144 |
|
| 145 |
*--verbose-upload*:: |
| 146 |
Enable verbose mode during upload. If this option is not given, |
| 147 |
verbose mode during upload is *disabled* regardless of the current |
| 148 |
preferences. |
| 149 |
|
| 150 |
{empty}:: |
| 151 |
This option is only valid together with *--verify* or |
| 152 |
*--upload*. |
| 153 |
|
| 154 |
*-v, --verbose*:: |
| 155 |
Enable verbose mode during build and upload. |
| 156 |
This option has the same effect of using both *--verbose-build* |
| 157 |
and *--verbose-upload*. |
| 158 |
|
| 159 |
{empty}:: |
| 160 |
This option is only valid together with *--verify* or |
| 161 |
*--upload*. |
| 162 |
|
| 163 |
*--preferences-file* __filename__:: |
| 164 |
Read and store preferences from the specified __filename__ instead |
| 165 |
of the default one. |
| 166 |
|
| 167 |
*--pref* __name__=__value__:: |
| 168 |
Sets the preference __name__ to the given __value__. |
| 169 |
|
| 170 |
{empty}:: |
| 171 |
Note that the preferences you set with this option are not |
| 172 |
validated: Invalid names will be set but never used, invalid |
| 173 |
values might lead to an error later on. |
| 174 |
|
| 175 |
*--save-prefs*:: |
| 176 |
Save any (changed) preferences to *preferences.txt*. In particular |
| 177 |
*--board*, *--port*, *--pref*, *--verbose*, *--verbose-build* and |
| 178 |
*--verbose-upload* may alter the current preferences. |
| 179 |
|
| 180 |
PREFERENCES |
| 181 |
----------- |
| 182 |
Arduino keeps a list of preferences, as simple name and value pairs. |
| 183 |
Below, a few of them are documented but a lot more are available. |
| 184 |
|
| 185 |
*sketchbook.path*:: |
| 186 |
The path where sketches are (usually) stored. This path can also |
| 187 |
contain some special subdirectories (see FILES below). |
| 188 |
|
| 189 |
*update.check*:: |
| 190 |
When set to true, the IDE checks for a new version on startup. |
| 191 |
|
| 192 |
*editor.external*:: |
| 193 |
When set to true, use an external editor (the IDE does not allow |
| 194 |
editing and reloads each file before verifying). |
| 195 |
|
| 196 |
*build.path*:: |
| 197 |
The path to use for building. This is where things like the |
| 198 |
preprocessed .cpp file, compiled .o files and the final .hex |
| 199 |
file go. |
| 200 |
|
| 201 |
{empty}:: |
| 202 |
If set, this directory should already exist before running the |
| 203 |
arduino command. |
| 204 |
|
| 205 |
{empty}:: |
| 206 |
If this preference is not set (which is normally the case), a |
| 207 |
new temporary build folder is created on every run and deleted |
| 208 |
again when the application is closed. |
| 209 |
|
| 210 |
EXIT STATUS |
| 211 |
----------- |
| 212 |
*0*:: Success |
| 213 |
*1*:: Build failed or upload failed |
| 214 |
*2*:: Sketch not found |
| 215 |
*3*:: Invalid (argument for) commandline option |
| 216 |
*4*:: Preference passed to *--get-pref* does not exist |
| 217 |
|
| 218 |
FILES |
| 219 |
----- |
| 220 |
*%LOCALAPPDATA%/Arduino15/preferences.txt* (Windows):: |
| 221 |
*~/Library/Arduino15/preferences.txt* (Max OS X):: |
| 222 |
*~/.arduino15/preferences.txt* (Linux):: |
| 223 |
This file stores the preferences used for the IDE, building and |
| 224 |
uploading sketches. |
| 225 |
|
| 226 |
*My Documents/Arduino/* (Windows):: |
| 227 |
*~/Documents/Arduino/* (Mac OS X):: |
| 228 |
*~/Arduino/* (Linux):: |
| 229 |
This directory is referred to as the "Sketchbook" and contains |
| 230 |
the user's sketches. The path can be changed through the |
| 231 |
*sketchbook.path* preference. |
| 232 |
|
| 233 |
{empty}:: |
| 234 |
Apart from sketches, three special directories can be inside the |
| 235 |
sketchbook: |
| 236 |
|
| 237 |
*libraries*::: |
| 238 |
Libraries can be put inside this directory, one library |
| 239 |
per subdirectory. |
| 240 |
|
| 241 |
*hardware*::: |
| 242 |
Support for third-party hardware can be added through |
| 243 |
this directory. |
| 244 |
|
| 245 |
*tools*::: |
| 246 |
External code-processing tools (that can be run through |
| 247 |
the Tools menu of the IDE) can be added here. |
| 248 |
|
| 249 |
EXAMPLES |
| 250 |
-------- |
| 251 |
|
| 252 |
Start the Arduino IDE, with two files open: |
| 253 |
|
| 254 |
arduino /path/to/sketch/sketch.ino /path/to/sketch/extra.ino |
| 255 |
|
| 256 |
Compile and upload a sketch using the last selected board and serial port |
| 257 |
|
| 258 |
arduino --upload /path/to/sketch/sketch.ino |
| 259 |
|
| 260 |
Compile and upload a sketch to an Arduino Nano, with an Atmega168 CPU, |
| 261 |
connected on port '/dev/ttyACM0': |
| 262 |
|
| 263 |
arduino --board arduino:avr:nano:cpu=atmega168 --port /dev/ttyACM0 --upload /path/to/sketch/sketch.ino |
| 264 |
|
| 265 |
Compile a sketch, put the build results in the 'build' directory an |
| 266 |
re-use any previous build results in that directory. |
| 267 |
|
| 268 |
arduino --pref build.path=/path/to/sketch/build --verify /path/to/sketch/sketch.ino |
| 269 |
|
| 270 |
Change the selected board and build path and do nothing else. |
| 271 |
|
| 272 |
arduino --pref build.path=/path/to/sketch/build --board arduino:avr:uno --save-prefs |
| 273 |
|
| 274 |
Install latest SAM board support |
| 275 |
|
| 276 |
arduino --install-boards "arduino:sam" |
| 277 |
|
| 278 |
Install AVR board support, 1.6.2 |
| 279 |
|
| 280 |
arduino --install-boards "arduino:avr:1.6.2" |
| 281 |
|
| 282 |
Install Bridge library version 1.0.0 |
| 283 |
|
| 284 |
arduino --install-library "Bridge:1.0.0" |
| 285 |
|
| 286 |
Install Bridge and Servo libraries |
| 287 |
|
| 288 |
arduino --install-library "Bridge:1.0.0,Servo:1.2.0" |
| 289 |
|
| 290 |
HISTORY |
| 291 |
------- |
| 292 |
1.5.2:: |
| 293 |
Added initial commandline support. This introduced *--verify*, |
| 294 |
*--upload*, *--board*, *--port*, *--verbose* and *-v*. |
| 295 |
|
| 296 |
1.5.5:: |
| 297 |
Added support for board-specific parameters to *--board*. |
| 298 |
|
| 299 |
{empty}:: |
| 300 |
Sketch filenames are now interpreted relative to the current |
| 301 |
directory instead of the location of the arduino command itself. |
| 302 |
|
| 303 |
1.5.6:: |
| 304 |
Introduced *--pref*, *--preferences-file*, *--verbose-build* and |
| 305 |
*--verbose-upload*. |
| 306 |
|
| 307 |
{empty}:: |
| 308 |
Preferences set through --pref are remembered, preferences set |
| 309 |
through *--board*, *--port* or the *--verbose* options are not. |
| 310 |
|
| 311 |
{empty}:: |
| 312 |
When running with *--verify* or *--upload*, the full GUI is no |
| 313 |
longer shown. Error messages still use a graphical popup and on |
| 314 |
Windows, the splash screen is still shown. |
| 315 |
|
| 316 |
1.5.8:: |
| 317 |
Introduced *--save-prefs*. |
| 318 |
|
| 319 |
1.6.2:: |
| 320 |
Main executable in MacOS X changed from |
| 321 |
'Arduino.app/Contents/MacOS/JavaApplicationStub' to |
| 322 |
'Arduino.app/Contents/MacOS/Arduino'. |
| 323 |
|
| 324 |
1.6.4:: |
| 325 |
Introduced *--install-boards* and *--install-library*. |
| 326 |
|
| 327 |
{empty}:: |
| 328 |
*--pref* options are now not saved to the preferences file, just |
| 329 |
like *--board* and *--port*, unless *--save-prefs* is specified. |
| 330 |
|
| 331 |
{empty}:: |
| 332 |
A path passed to *--preferences-file*, or set in the |
| 333 |
*build.path*, *preferences.path* or *settings.path* is now |
| 334 |
interpreted relative to the current directory instead of the |
| 335 |
location of the arduino command itself. |
| 336 |
|
| 337 |
|
| 338 |
RESOURCES |
| 339 |
--------- |
| 340 |
Web site: <http://www.arduino.cc/> |
| 341 |
|
| 342 |
Help on projects and programming: <http://forum.arduino.cc/> |
| 343 |
|
| 344 |
Report bugs: <http://github.com/arduino/Arduino/issues> |
| 345 |
|
| 346 |
IDE and framework development mailing list: <https://groups.google.com/a/arduino.cc/forum/#!forum/developers> |