Alex's Slip-box

These are my org-mode notes in sort of Zettelkasten style

arduino-cli

:ID: 6bd4de5b-bb93-4862-bae7-f34046344f50

# Quick start

# Installation.

# Search for the ID for the platform you need

arduino-cli core search avr

# Install the core/platform you need

arduino-cli core install arduino:avr

# Search for the FQDN for the board you have

arduino-cli board listall leonardo

# Compile the sketch

Use --dump-profile to output what can use used to create a sketch.yaml. This file is useful for dependency management (eg, locking version)

arduino-cli compile -b arduino:avr:leonardo path/to/project --dump-profile

When using a profile:

arduino-cli compile --profile mixxx_midi_clock --export-binaries

# Install dependencies if needed

If the compilation fails due to missing some dependencies, then install them. They will be installed to:

~/Arduino/libraries/MIDIUSB

See also https://arduino.github.io/arduino-cli/commands/arduino-cli_lib_install/

arduino-cli lib install MIDIUSB

Can install from a git URL too. But will need to configure the CLI with for this:

arduino-cli config set library.enable_unsafe_install true
arduino-cli lib install --git-url https://github.com/FortySevenEffects/arduino_midi_library

# Upload hex file to the device.

Weirdly the arduino-cli doesn’t support this. Instead use avrdude.

First, you need to know which tty the device is on:

See also Find TTY for USB device

Example command to upload a hex file to Arduino Leonardo (NEED TO HIT RESET BUTTON TO GET DEVICE INTO BOOTLOADER MODE FIRST)

avrdude -c avr109 -P /dev/ttyACM0 -b 57600 -p atmega32u4 -D -U flash:w:mixxx_midi_clock.ino.hex:i

Search Results