diff --git a/.github/workflows/compile_examples.yml b/.github/workflows/compile_examples.yml index 9708bbf5f..01bb094ce 100644 --- a/.github/workflows/compile_examples.yml +++ b/.github/workflows/compile_examples.yml @@ -41,6 +41,10 @@ jobs: platforms: | - name: esp8266:esp8266 source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json + # SAMD boards. There is also an Adrafruit fork of this core, and the two seem to have diverged, considerably. I have no idea on the differences. + - fqbn: arduino:samd:adafruit_circuitplayground_m0 + platforms: | + - name: arduino:samd steps: - name: Checkout repository diff --git a/MozziGuts_impl_SAMD.hpp b/MozziGuts_impl_SAMD.hpp index a8f1be715..03cc61910 100644 --- a/MozziGuts_impl_SAMD.hpp +++ b/MozziGuts_impl_SAMD.hpp @@ -123,7 +123,7 @@ static void startAudio() { } #endif - analogWriteResolution(10); + analogWriteResolution(AUDIO_BITS); #if (EXTERNAL_AUDIO_OUTPUT != true) analogWrite(AUDIO_CHANNEL_1_PIN, 0); #endif diff --git a/README.md b/README.md index d55bb3df3..3f1baafeb 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,14 @@ Some of the differences for Teensy 4.*: - Contrary to the Teensy 3, the Teensy 4 do not have any DAC. The output is done on pin A8 (PWM) by default (editable in `AudioConfigTeensy4.h` +### SAMD21 architecture (Arduino Circuitplayground M0 and others) +port by Adrian Freed + +- Currently, only output on the inbuilt DAC (pin DAC0) is supported. So, obviously, boards without a DAC are not yet convered (in theory you can still use EXTERNAL_AUDIO_OUTPUT) +- Output resolution is fixed at 10 bits. If your board supports more, configure in AudioConfigSAMD21.h +- mozziAnalogRead() and AUDIO_INPUT are not implemented (contributions welcome) +- We don't have a lot of data, which boards this port has been tested on. Success or not, let us know, if you are using Mozzi on SAMD21 boards + ### ESP8266 port by Thomas Friedrichsmeier