ARDUINO(1)
π ARDUINO π
okay bestie, welcome to the arduino(1) manual β this is the integrated development environment for Arduino boards, and yes she is THAT girl. sit down, get comfy, we're going through literally everything π«Ά
πΈ SYNOPSIS πΈ
arduino [FILE.ino...]
arduino [--verify|--upload] [--board package:arch:board[:parameters]]
[--port portname] [--pref name=value] [-v|--verbose]
[--preserve-temp-files] [FILE.ino]
arduino [--get-pref [preference]]
arduino [--install-boards package name:platform architecture[:version]]
arduino [--install-library library name[:version][,library
name[:version],library name[:version]]
arduino [--version]
β¨ DESCRIPTION β¨
so the arduino integrated development environment is the whole vibe for editing, compiling and uploading sketches (which is just a cute word for programs, iykyk) for Arduino and Arduino-compatible microcontroller boards. π
normally, running the arduino command just starts the IDE, optionally loading any .ino files you put on the commandline. classic.
but alternatively β and this is the part that eats β if any of the following command line options is given, no graphical interface will be shown. 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. no half measures, periodt. π
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. lowkey a time-saver, fr fr.
note bestie: on MacOS X, the main executable isArduino.app/Contents/MacOS/Arduinoinstead ofarduino. she lives in a whole app bundle, iconic but also confusing.
also note: on Windows, due to the diffence between GUI and console apps, that thearduino_debug.exeis the appropriate executable to use if you want to use the majority of these command line options. thearduino.exeGUI version of the launcher may perform some of the functions described below, but will not output any messages to the console, meaning it is pretty useless if you want any feedback or to be able to keep log files for automated testing, etc. π so use the debug one, trust.
π ACTIONS π
--verifyβ Build the sketch. just build. no upload, just vibes and compilation. π οΈ--uploadβ Build and upload the sketch. build then yeet it onto the board. π--get-pref [preference]β 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 (go peek at EXIT STATUS below). if no preference is given as parameter, it prints all preferences. she's thorough. π--install-boards package name:platform architecture[:version]β 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 code1. if a platform with a different version is already installed, it's replaced. out with the old. π--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 code1. if a library with a different version is already installed, it's replaced. multiple libraries can be specified, separated by a comma. yes you can bring your friends. π«Ά--versionβ Print the version information and exit. short, sweet, slays.
π OPTIONS π
--board package:arch:board[:parameters]β Select the board to compile for. this one has lore, so buckle up:- package is the identifier of the vendor (the first level folders inside the
hardwaredirectory). default arduino boards usearduino. - architecture is the architecture of the board (second level folders inside the
hardwaredirectory). default arduino boards use eitherarduino:avrfor all AVR-based boards (like Uno, Mega or Leonardo) orarduino:samfor 32bit SAM-based boards (like Arduino Due). - board is the actual board to use, as defined in
boards.txtcontained in the architecture folder selected. for examplearduino:avr:unofor the Arduino Uno,arduino:avr:diecimilafor the Arduino Duemilanove or Diecimila, orarduino:avr:megafor 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=atmega168to Select the mega168 variant of the Arduino Nano board.
- package is the identifier of the vendor (the first level folders inside the
if this option is not passed, the value from the current preferences is used (e.g., the last board selected in the IDE). she remembers. π§
--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).
if this option is not passed, the value from the current preferences is used (e.g., the last port selected in the IDE). again, she remembers. π
--verbose-buildβ Enable verbose mode during build. if this option is not given, verbose mode during build is disabled regardless of the current preferences. no secrets here.--preserve-temp-filesβ Keep temporary files (preprocessed sketch, object files...) after termination. if omitted, temporary files are deleted. ποΈ
this option is only valid together with--verifyor--upload. don't try it solo, she won't answer.
--useprogrammerβ Upload using a programmer. set if you're using an external programmer, or using the Arduino as ISP. main character external-tool energy. π--verbose-uploadβ Enable verbose mode during upload. if this option is not given, verbose mode during upload is disabled regardless of the current preferences.
this option is only valid together with--verifyor--upload. bestie. read the room.
-v,--verboseβ Enable verbose mode during build and upload. this option has the same effect of using both--verbose-buildand--verbose-upload. two birds, one flag. π¦
this option is only valid together with--verifyor--upload. yes, again. it's a theme.
--preferences-file filenameβ Read and store preferences from the specified filename instead of the default one. pick your own file, be free. π--pref name=valueβ Sets the preference name to the given value.
β οΈ 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. she's not checking your work, she's just writing it down. π
--save-prefsβ Save any (changed) preferences topreferences.txt. in particular--board,--port,--pref,--verbose,--verbose-buildand--verbose-uploadmay alter the current preferences. save your work bestie. πΎ
π¦ 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. the lore goes deep, this is just the highlights.
sketchbook.pathβ The path where sketches are (usually) stored. this path can also contain some special subdirectories (go see FILES below).update.checkβ When set totrue, the IDE checks for a new version on startup. she's nosy about updates, honestly same.editor.externalβ When set totrue, use an external editor (the IDE does not allow editing and reloads each file before verifying). let her outsource the typing.build.pathβ The path to use for building. this is where things like the preprocessed.cppfile, compiled.ofiles and the final.hexfile go.
if set, this directory should already exist before running the arduino command. she will not create it for you. π
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. ephemeral queen. β¨
π EXIT STATUS π
0β Success. ate and left no crumbs. π1β Build failed or upload failed. it happens to the best of us. π2β Sketch not found. she looked everywhere bestie.3β Invalid (argument for) commandline option. that flag is not on the menu. π«4β Preference passed to--get-prefdoes not exist. nothing to print, so she told you with a number instead.
π FILES π
%LOCALAPPDATA%/Arduino15/preferences.txt(Windows),~/Library/Arduino15/preferences.txt(Max OS X),~/.arduino15/preferences.txt(Linux)- This file stores the preferences used for the IDE, building and uploading sketches. her diary, basically. π
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.pathpreference.
- This directory is referred to as the "Sketchbook" and contains the user's sketches. the path can be changed through the
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
Change the selected board and build path and do nothing else:
arduino --pref build.path=/path/to/sketch/build --board arduino:avr:uno --save-prefs
Install latest SAM board support:
arduino --install-boards "arduino:sam"
Install AVR board support, 1.6.2:
arduino --install-boards "arduino:avr:1.6.2"
Install Bridge library version 1.0.0:
arduino --install-library "Bridge:1.0.0"
Install Bridge and Servo libraries:
arduino --install-library "Bridge:1.0.0,Servo:1.2.0"
β¨ HISTORY β¨
okay so let's take a lil trip down memory lane bestie, because this command line glow-up did not happen overnight π
1.5.2 π
this is when the command line first got its whole thing going β¨ it brought us --verify, --upload, --board, --port, --verbose and -v. iconic behavior tbh.
1.5.5 π¦
--board started accepting board-specific parameters, slay π
also, sketch filenames? they're now read relative to the current directory, not wherever the arduino command itself lives. no cap.
1.5.6 πΈ
new besties arrived: --pref, --preferences-file, --verbose-build and --verbose-upload π here's the tea: prefs you set with --pref stick around, but prefs from --board, --port or the --verbose options? nope, not remembered. also when you run with --verify or --upload, the full GUI doesn't show up anymore. error messages still pop up graphically tho, and on Windows the splash screen is still there, so don't worry.
1.5.8 π
--save-prefs said hi for the first time π
1.6.2 π
on MacOS X, the main executable moved from Arduino.app/Contents/MacOS/JavaApplicationStub to Arduino.app/Contents/MacOS/Arduino. glow up fr π
1.6.4 π₯
--install-boards and --install-library made their debut β¨ and big shift: --pref options are now not saved to the preferences file, just like --board and --port β unless you specifically say --save-prefs. also, a path you pass to --preferences-file, or set in build.path, preferences.path or settings.path, is now read relative to the current directory instead of where the arduino command itself is. periodt.
π RESOURCES π
need the links bestie? here you go π«Ά
- Web site:
http://www.arduino.cc/ - 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
that's the whole page from ARDUINO(1), dated 12/27/2021 π stay slay, stay curious, and go make something cute with a microcontroller bestie β¨π¦
π¦ where this page comes from
- debian bookworm: arduino 2:1.8.19+dfsg1-1 Β· CC-BY-SA-3.0
- ubuntu jammy: arduino 2:1.8.19+dfsg1-1 Β· CC-BY-SA-3.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms