Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 46 additions & 9 deletions .github/workflows/compile-sketches.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Compiles sketches on every push to master and every PR, so a change that breaks
# a sketch is caught before it lands. Mirrors the CI in makelab-arduino-lib.
#
# START-GREEN POLICY: this gates only on folders verified to compile cleanly (via
# START-GREEN POLICY: this gates only on sketches verified to compile cleanly (via
# a full arduino-cli sweep). Coverage grows as issues close:
# - ESP32/ is mid core-v3.x migration .......... #12
# - Sensors/PlayingMusic/AddressableLEDs/Serial have wrong-board sketches that
# need per-sketch sketch.yaml board targeting .. #11
# - CPX/ (samd), nRF52840/ (nrf52), UnoR4WiFi/ ... add once their heavier cores
# are wired in here.
# - The board-specific sketches in Sensors/AddressableLEDs/Serial are now gated
# on their real boards (SAMD / nRF52 / Leonardo) via the matrix jobs below; the
# per-sketch target lives in each sketch's sketch.yaml ........... #11
# - The remaining plain-Uno sketches in Sensors/PlayingMusic/AddressableLEDs/
# Serial all compile green and can be added to the Uno job in a follow-up.
# NOTE: arduino/compile-sketches compiles every sketch in a job with that job's
# single fqbn — it does NOT read sketch.yaml. So a folder path can only be gated
# wholesale when every sketch under it targets the same board; mixed-board folders
# must list individual sketches under the matching board's job.
# Legacy sketches (docs/legacy-sketches.md) are never gated; add a skip step here
# when a gated folder starts including any.
name: Compile Sketches
Expand All @@ -27,28 +32,57 @@ jobs:
matrix:
include:
- fqbn: arduino:avr:uno
platform: arduino:avr
platforms: |
- name: arduino:avr
sketch-paths: |
- Basics
- OLED
- Filters
- Servo
- fqbn: arduino:avr:leonardo
platform: arduino:avr
platforms: |
- name: arduino:avr
sketch-paths: |
- HumanInterfaceDevice
- GameController
# Serial1 (a second hardware UART) doesn't exist on the Uno; these
# need a Leonardo-class board. See each sketch's sketch.yaml.
- Serial/SimpleSerial1Transmitter
- Serial/SimpleSerial1Receiver
- Serial/SimpleSerial1Bidirectional
# I2S MEMS-mic sketches: hardware I2S peripheral ⇒ SAMD (Feather M0).
# I2S.h ships with the Adafruit SAMD core (no separate library).
- fqbn: adafruit:samd:adafruit_feather_m0_express
platforms: |
- name: adafruit:samd
source-url: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
sketch-paths: |
- Sensors/i2s-Microphone
# Onboard-NeoPixel sketches (PIN_NEOPIXEL) ⇒ nRF52840 Feather.
- fqbn: adafruit:nrf52:feather52840
platforms: |
- name: adafruit:nrf52
source-url: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
sketch-paths: |
- AddressableLEDs/NeoPixel/BlinkOnboardNeoPixel
- Sensors/Microphone/SoundLevelOnboardNeopixel

steps:
- name: Checkout
uses: actions/checkout@v4

# The Adafruit nRF52 core invokes adafruit-nrfutil (a pip tool) from its
# build recipe even for a plain compile, so it must be on PATH. It's
# bundled in a normal IDE install but not on the CI runner.
- name: Install adafruit-nrfutil (nRF52 build recipe needs it)
if: startsWith(matrix.fqbn, 'adafruit:nrf52')
run: pip install adafruit-nrfutil

- name: Compile sketches
uses: arduino/compile-sketches@v1
with:
fqbn: ${{ matrix.fqbn }}
platforms: |
- name: ${{ matrix.platform }}
platforms: ${{ matrix.platforms }}
# Libraries used by the gated folders. The MakeabilityLab library is
# installed straight from its repo (not yet in Library Manager). The
# rest come from Library Manager; deps are listed explicitly so an
Expand All @@ -65,6 +99,9 @@ jobs:
- name: Servo
- name: Mouse
- name: Keyboard
- name: Adafruit NeoPixel
- name: Adafruit Zero I2S Library
- name: Adafruit Zero DMA Library
sketch-paths: ${{ matrix.sketch-paths }}
enable-warnings-report: true
verbose: false
4 changes: 4 additions & 0 deletions AddressableLEDs/NeoPixel/BlinkOnboardNeoPixel/sketch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Adafruit Feather nRF52840 Express).
default_fqbn: adafruit:nrf52:feather52840
4 changes: 3 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ There is **no build system, package manifest, or automated test suite.** Each pr
```
arduino-cli compile --fqbn <board-fqbn> <SketchFolder>
```
Each sketch lives in its own folder whose name matches the `.ino` file (Arduino requirement). There is no committed board config; choose the FQBN per sketch by hardware folder:
Each sketch lives in its own folder whose name matches the `.ino` file (Arduino requirement). Most sketches have no committed board configchoose the FQBN per sketch by hardware folder (table below). The exceptions are board-specific sketches that carry a `sketch.yaml` pinning their exact target (see note after the table):
| Folder | Board | FQBN |
|---|---|---|
| `Basics/`, `OLED/`, `Filters/`, `Sensors/`, `Servo/`, etc. | Arduino Uno (AVR) | `arduino:avr:uno` |
Expand All @@ -29,6 +29,8 @@ There is **no build system, package manifest, or automated test suite.** Each pr
| `nRF52840/` | nRF52840 board (verify exact board) | `adafruit:nrf52:feather52840` |

Installed cores: `arduino:avr`, `arduino:renesas_uno`, `esp32:esp32`, `adafruit:samd`, `adafruit:nrf52`. The AVR/HID split is inferred from each sketch's APIs (`Mouse.h`/`Keyboard.h` ⇒ Leonardo-class); the `nRF52840/` board defaults to Feather Express but confirm the exact board from the sketch header. Legacy `RedBearDuo/` and Processing have no installable core — skip compile-checking them.

**Per-sketch `sketch.yaml` (board pinning):** a handful of sketches whose required board differs from their folder default (e.g. the i2s-mic sketches under `Sensors/` need SAMD, the `Serial1` sketches need a Leonardo) carry a one-key `sketch.yaml` with `default_fqbn:`. `arduino-cli` reads it so a bare `arduino-cli compile <Folder>` targets the right board; students using the Arduino IDE still select the board manually via `Tools → Board` (the file just shows as a tab). Each `sketch.yaml` is commented to explain this so it isn't a mystery to readers. Note: `arduino/compile-sketches` (the CI action) does **not** read `sketch.yaml` — it compiles a folder with one FQBN per matrix job — so the CI matrix in `.github/workflows/compile-sketches.yml` must independently list mixed-board sketches under the matching board's job.
- **Python helpers** (`Python/`): require Python 3 and `pip install pyserial`. Run directly, e.g. `python Python/SerialReader/serial_reader.py --list`. Note the common pitfall: install `pyserial`, **not** `serial`.
- **Processing sketches** (`.pde`, `Processing/`): legacy/historical only — the project has shifted to p5.js. Don't invest in modernizing these unless asked.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// ============================================================================
// LEGACY EXAMPLE (does not compile).
// An abandoned experiment: it #includes the SAMD-only <I2S.h> on an nRF52840
// Feather, and—per the original note below—the i2s-mic and VS1053 mp3 libraries
// are mutually incompatible, so it never worked. Kept for reference only.
// Excluded from compile CI. See docs/legacy-sketches.md.
// ============================================================================
/**
* WARNING: this sketch doesn't work due to incompatibilities between the i2s mic library
* and the mp3 player library.
Expand Down
4 changes: 4 additions & 0 deletions Sensors/Microphone/SoundLevelOnboardNeopixel/sketch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Adafruit Feather nRF52840 Express).
default_fqbn: adafruit:nrf52:feather52840
4 changes: 4 additions & 0 deletions Sensors/i2s-Microphone/MicInputPlotter/sketch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Adafruit Feather M0 Express).
default_fqbn: adafruit:samd:adafruit_feather_m0_express
4 changes: 4 additions & 0 deletions Sensors/i2s-Microphone/MicInputPlotterInterrupt/sketch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Adafruit Feather M0 Express).
default_fqbn: adafruit:samd:adafruit_feather_m0_express
4 changes: 4 additions & 0 deletions Sensors/i2s-Microphone/MicPlotterAdafruitZeroI2s/sketch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Adafruit Feather M0 Express).
default_fqbn: adafruit:samd:adafruit_feather_m0_express
4 changes: 4 additions & 0 deletions Sensors/i2s-Microphone/VUMeter/sketch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Adafruit Feather M0 Express).
default_fqbn: adafruit:samd:adafruit_feather_m0_express
4 changes: 4 additions & 0 deletions Sensors/i2s-Microphone/VUMeterInterrupt/sketch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Adafruit Feather M0 Express).
default_fqbn: adafruit:samd:adafruit_feather_m0_express
4 changes: 4 additions & 0 deletions Sensors/i2s-Microphone/VUMeterInterruptLED/sketch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Adafruit Feather M0 Express).
default_fqbn: adafruit:samd:adafruit_feather_m0_express
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Adafruit Feather M0 Express).
default_fqbn: adafruit:samd:adafruit_feather_m0_express
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Adafruit Feather M0 Express).
default_fqbn: adafruit:samd:adafruit_feather_m0_express
4 changes: 4 additions & 0 deletions Serial/SimpleSerial1Bidirectional/sketch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Arduino Leonardo).
default_fqbn: arduino:avr:leonardo
4 changes: 4 additions & 0 deletions Serial/SimpleSerial1Receiver/sketch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Arduino Leonardo).
default_fqbn: arduino:avr:leonardo
4 changes: 4 additions & 0 deletions Serial/SimpleSerial1Transmitter/sketch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Records the board this sketch is written for, so the Arduino CLI and our
# compile-check CI build it for the right target. In the IDE you still pick the
# board yourself via Tools -> Board (here: Arduino Leonardo).
default_fqbn: arduino:avr:leonardo
9 changes: 9 additions & 0 deletions docs/legacy-sketches.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ ESP32/Tone/AnalogInputToneWithOLED
ESP32/Tone/BallBounceTone32WithOLED
ESP32/Tone/PlayScale
ESP32/Tone/PlayScaleWithOLED

## PlayingMusic — abandoned i2s-mic + mp3 experiment (never worked)

`SimpleMp3PlayerWithi2sMic` #includes the SAMD-only `<I2S.h>` on an nRF52840
Feather and combines the i2s-mic and Adafruit VS1053 mp3 libraries, which are
mutually incompatible — the sketch's own header documents that it never worked.
Kept for reference; it compiles on no board.

PlayingMusic/SimpleMp3PlayerWithi2sMic
Loading