Arduino Makefile
to simplify testing and uploading Arduino sketches from the command line.
ArduinoCLI installed and in your $PATH
.
Place this Makefile
in your sketch directory.
export BOARD=arduino:avr:uno && export PORT=/dev/ttyACM0
or
Edit the Makefile
itself and configure the BOARD
and PORT
options.
- Verify code compiles:
make
- Upload to board:
make upload
- Open serial monitor:
make monitor
Verify your code compiles and uploads via the ArduinoIDE. Next verify that it works with the ArduinoCLI. If it does not work with the vanilla arduino-cli
it will not work with this Makefile
.