Arduino Setup Guide - ISS-Mimic/Mimic GitHub Wiki
- Grab the latest “Arduino IDE 2” from https://arduino.cc/software and install with default options.
- Launch it once so the preferences file is created.
You can keep IDE 1.x side-by-side; they share boards + libraries.
-
File ▸ Preferences ▸ Additional Boards Manager URLs → paste
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json -
Tools ▸ Board ▸ Boards Manager
Search “Adafruit SAMD” → Install. - Restart the IDE so the new tool-chain loads.
(Installing the official Arduino SAMD Boards package as well won’t hurt and is recommended by most tutorials.)
Install each of the libraries in the table below once via Tools ▸ Library Manager (or arduino-cli lib install …).
Anything not listed ships with the Arduino IDE or the Adafruit SAMD core already (e.g. Wire.h, SPI.h, Servo.h, String.h, string.h, etc.) and therefore needs no manual action.
| Sketch folder(s) that pull it in | Library to install | Notes |
|---|---|---|
LED Controller |
FastLED 3.6.0 | Needs to be version 3.6.0 or it might not compile on Metro M0s (other boards might work) |
Port_BGA, Starboard_BGA, SARJ_TRRJ
|
Encoder (by Paul Stoffregen) | Reads the quadrature shaft encoders on the BGAs |
Port_BGA, Starboard_BGA, SARJ_TRRJ
|
Adafruit Motor Shield v2 Library (brings in utility/Adafruit_MS_PWMServoDriver.h) |
Drives the dual-stepper TB6612 FETs on the Motor Shield |
Quick one-liner (CLI users)
arduino-cli lib install \ "[email protected]" \ Encoder \ "Adafruit Motor Shield V2 Library" \
<string.h> is part of the standard C library baked into every Arduino core, so nothing extra is needed.
With the above libraries installed, every .ino in the active folders will compile cleanly on a fresh Arduino IDE setup.
- Use a known-good USB 2.0 data cable (power-only cables are the #1 “won’t upload” cause).
- Normal draw for a Metro M0 is < 150 mA, so powering from a Pi hub or your PC is fine.
- The board should enumerate as
Windows:COMxx – Adafruit Metro M0 Express
macOS/Linux:/dev/cu.usbmodem…or/dev/ttyACM…
If you only see a generic USB serial device, double-tap RESET to enter the UF2 boot-loader; it will re-enumerate with the proper name.
Inside Mimic/Arduino/ you’ll find one folder per microcontroller:
| Folder | Uploads to | Notes |
|---|---|---|
Ard_PortBGAs_r18 |
Port-side Solar Array Controller | |
Ard_StbdBGAs_r18 |
Starboard-side Solar Array Controller | |
Ard_SARJs_TRRJs_r18 |
SARJ and TRRJ Controller | |
Mimic_LED_Controller |
LED Controller Board |
Each folder is already a sketch: the .ino file must match the folder
name for the Arduino IDE to open it cleanly (repo is already set up this way).
- Connect only the board you’re about to program.
-
File ▸ Open → pick the folder; IDE loads
⟨folder⟩.ino. - Tools ▸ Board → Adafruit SAMD → “Adafruit Metro M0 Express (SAMD21)”
- Tools ▸ Port → select the Metro’s port.
- Sketch ▸ Verify/Compile – catches missing libraries early.
- Sketch ▸ Upload (or press ▶).
Upload time ≈ 15 s.
If you see No device found on tty…, double-tap RESET and choose the new
“Bootloader” port that appears, then upload again.
| Symptom | Likely Cause | Recommended Fix |
|---|---|---|
SAM-BA operation failed |
Brown-out while flashing | Use a powered USB hub or unplug high-draw peripherals during upload. |
| “No device found” | Board not in boot-loader | Double-tap RESET, then choose the new “Bootloader” port in Tools ▸ Port. |
xyz.h: No such file |
Missing library | Install the library via Tools ▸ Library Manager and re-compile. |
| Upload hangs at 0 % | Wrong board selected | Set Tools ▸ Board to Adafruit Metro M0 Express (SAMD21). |
| Random resets at runtime | 5 V servo draws too much current | Power servos from a separate, regulated 5 V rail instead of the Metro’s 5 V pin. |
Still stuck? See Adafruit’s Metro M0 and generic SAMD troubleshooting pages for deeper dives.
After all sketches are loaded you can plug every Metro back into the Pi’s powered hub. For future in-situ updates:
- Label each USB cable with its subsystem – or –
- Give each sketch a unique USB string:
// in setup()
#define USB_PRODUCT "ISS-Mimic Port BGA"
The Adafruit SAMD core exposes this macro; recompiling makes the OS label
the port with your custom text.