|
| 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*] [__FILE.ino__] |
| 29 | + |
| 30 | +DESCRIPTION |
| 31 | +----------- |
| 32 | +The 'arduino' integrated development environment allows editing, |
| 33 | +compiling and uploading sketches (programs) for Arduino |
| 34 | +(and compatible) microcontroller boards. |
| 35 | + |
| 36 | +Normally, running the arduino command starts the IDE, optionally loading |
| 37 | +any .ino files specified on the commandline. |
| 38 | + |
| 39 | +Alternatively, if *--verify* or *--upload* is given, no graphical |
| 40 | +interface will be shown and instead a one-off verify (compile) or upload |
| 41 | +will be done. A single .ino file should be given. If the sketch contains |
| 42 | +multiple .ino files, any one can be specified on the commandline, but |
| 43 | +the entire sketch will be compiled. |
| 44 | + |
| 45 | +When running in a one-off mode, it might be useful to set the |
| 46 | +*build.path* preference to allow keeping intermediate build results |
| 47 | +between multiple runs and only recompile the files that changed. |
| 48 | + |
| 49 | +Note that on MacOS X, the main executable is |
| 50 | +'Arduino.app/Contents/MacOS/JavaApplicationStub' instead of 'arduino'. |
| 51 | + |
| 52 | +OPTIONS |
| 53 | +------- |
| 54 | +*--board* __package__:__arch__:__board__[:__parameters__]:: |
| 55 | + Select the board to compile for. |
| 56 | + |
| 57 | + * __package__ is the identifier of the vendor (the first |
| 58 | + level folders inside the 'hardware' directory). Default |
| 59 | + arduino boards use 'arduino'. |
| 60 | + * __architecture__ is the architecture of the board (second level folders |
| 61 | + inside the 'hardware' directory). Default arduino boards use |
| 62 | + either *arduino:avr* for all AVR-based boards (like Uno, Mega |
| 63 | + or Leonardo) or *arduino:sam* for 32bit SAM-based boards |
| 64 | + (like Arduino Due). |
| 65 | + * __board__ is the actual board to use, as defined in 'boards.txt' |
| 66 | + contained in the architecture folder selected. For example, |
| 67 | + *arduino:avr:uno* for the Arduino Uno, |
| 68 | + *arduino:avr:diecimila* for the Arduino Duemilanove or |
| 69 | + Diecimila, or *arduino:avr:mega* for the Arduino Mega. |
| 70 | + * __parameters__ is a comma-separated list of boards specific parameters |
| 71 | + that are normally shown under submenus of the "Tools" menu. For |
| 72 | + example *arduino:avr:nano:cpu=atmega168* to Select the mega168 |
| 73 | + variant of the Arduino Nano board. |
| 74 | + |
| 75 | +{empty}:: |
| 76 | + If this option is not passed, the value from the current |
| 77 | + preferences is used (e.g., the last board selected in the IDE). |
| 78 | + |
| 79 | +*--port* __portname__:: |
| 80 | + Select the serial port to perform upload of the sketch. |
| 81 | + On linux and MacOS X, this should be the path to a device file (e.g., |
| 82 | + */dev/ttyACM0*). On Windows, this should be the name of the serial |
| 83 | + port (e.g., *COM3*). |
| 84 | + |
| 85 | +{empty}:: |
| 86 | + If this option is not passed, the value from the current |
| 87 | + preferences is used (e.g., the last port selected in the IDE). |
| 88 | + |
| 89 | +*-v, --verbose*:: |
| 90 | + |
| 91 | + Enable verbose mode during build and upload. If this option is |
| 92 | + not given, verbose mode is disabled regardless of the current |
| 93 | + preferences. |
| 94 | + |
| 95 | +*--pref* __name__=__value__:: |
| 96 | + Sets the preference __name__ to the given __value__. |
| 97 | + |
| 98 | +{empty}:: |
| 99 | + Currently the preferences set are saved to 'preferences.txt', but |
| 100 | + this might change in the future (making them only active during |
| 101 | + the current invocation). |
| 102 | + |
| 103 | +{empty}:: |
| 104 | + Note that the preferences you set with this option are not |
| 105 | + validated: Invalid names will be set but never used, invalid |
| 106 | + values might lead to an error later on. |
| 107 | + |
| 108 | +*--upload*:: |
| 109 | + Build and upload the sketch. |
| 110 | + |
| 111 | +*--verify*:: |
| 112 | + Build the sketch. |
| 113 | + |
| 114 | +PREFERENCES |
| 115 | +----------- |
| 116 | +Arduino keeps a list of preferences, as simple name and value pairs. |
| 117 | +Below, a few of them are documented but a lot more are available. |
| 118 | +
|
| 119 | +*sketchbook.path*:: |
| 120 | + The path where sketches are (usually) stored. This path can also |
| 121 | + contain some special subdirectories (see FILES below). |
| 122 | +
|
| 123 | +*update.check*:: |
| 124 | + When set to true, the IDE checks for a new version on startup. |
| 125 | +
|
| 126 | +*editor.external*:: |
| 127 | + When set to true, use an external editor (the IDE does not allow |
| 128 | + editing and reloads each file before verifying). |
| 129 | +
|
| 130 | +*build.path*:: |
| 131 | + The path to use for building. This is where things like the |
| 132 | + preprocessed .cpp file, compiled .o files and the final .hex |
| 133 | + file go. |
| 134 | +
|
| 135 | +{empty}:: |
| 136 | + If set, this directory should already exist before running the |
| 137 | + arduino command. |
| 138 | +
|
| 139 | +{empty}:: |
| 140 | + If this preference is not set (which is normally the case), a |
| 141 | + new temporary build folder is created on every run and deleted |
| 142 | + again when the application is closed. |
| 143 | +
|
| 144 | +EXIT STATUS |
| 145 | +----------- |
| 146 | +*0*:: Success |
| 147 | +*1*:: Build failed or upload failed |
| 148 | +*2*:: Sketch not found |
| 149 | +*3*:: Invalid (argument for) commandline option |
| 150 | + |
| 151 | +FILES |
| 152 | +----- |
| 153 | +*~/.arduino15/preferences.txt*:: |
| 154 | + This file stores the preferences used for the IDE, building and |
| 155 | + uploading sketches. |
| 156 | +
|
| 157 | +*My Documents/Arduino/* (Windows):: |
| 158 | +*~/Documents/Arduino/* (Mac OS X):: |
| 159 | +*~/Arduino/* (Linux):: |
| 160 | + This directory is referred to as the "Sketchbook" and contains |
| 161 | + the user's sketches. The path can be changed through the |
| 162 | + *sketchbook.path* preference. |
| 163 | +
|
| 164 | +{empty}:: |
| 165 | + Apart from sketches, three special directories can be inside the |
| 166 | + sketchbook: |
| 167 | +
|
| 168 | + *libraries*::: |
| 169 | + Libraries can be put inside this directory, one library |
| 170 | + per subdirectory. |
| 171 | +
|
| 172 | + *hardware*::: |
| 173 | + Support for third-party hardware can be added through |
| 174 | + this directory. |
| 175 | +
|
| 176 | + *tools*::: |
| 177 | + External code-processing tools (that can be run through |
| 178 | + the Tools menu of the IDE) can be added here. |
| 179 | +
|
| 180 | +EXAMPLES |
| 181 | +-------- |
| 182 | + |
| 183 | +Start the Arduino IDE, with two files open: |
| 184 | + |
| 185 | + arduino /path/to/sketch/sketch.ino /path/to/sketch/extra.ino |
| 186 | + |
| 187 | +Compile and upload a sketch using the last selected board and serial port |
| 188 | + |
| 189 | + arduino --upload /path/to/sketch/sketch.ino |
| 190 | + |
| 191 | +Compile and upload a sketch to an Arduino Nano, with an Atmega168 CPU, |
| 192 | +connected on port '/dev/ttyACM0': |
| 193 | + |
| 194 | + arduino --board arduino:avr:nano:cpu=atmega168 --port /dev/ttyACM0 --upload /path/to/sketch/sketch.ino |
| 195 | + |
| 196 | +Compile a sketch, put the build results in the 'build' directory an |
| 197 | +re-use any previous build results in that directory. |
| 198 | + |
| 199 | + arduino --pref build.path=/path/to/sketch/build --verify /path/to/sketch/sketch.ino |
| 200 | + |
| 201 | +RESOURCES |
| 202 | +--------- |
| 203 | +Web site: <http://arduino.cc/> |
| 204 | +
|
| 205 | +Help on projects and programming: <http://forum.arduino.cc/> |
| 206 | +
|
| 207 | +Report bugs: <http://github.com/arduino/Arduino/issues> |
| 208 | +
|
| 209 | +IDE and framework development mailing list: <https://groups.google.com/a/arduino.cc/forum/#!forum/developers> |
0 commit comments