From 05487c5415d1d8787d47f27f723fe0a48a89a6ea Mon Sep 17 00:00:00 2001 From: lathoub <4082369+lathoub@users.noreply.github.com> Date: Mon, 20 Apr 2020 14:11:58 +0200 Subject: [PATCH] Example not relevant for Due and ZERO as they lack support for SoftwareSerial --- examples/AltPinSerial/AltPinSerial.ino | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/examples/AltPinSerial/AltPinSerial.ino b/examples/AltPinSerial/AltPinSerial.ino index 3e06dcc..386fbca 100644 --- a/examples/AltPinSerial/AltPinSerial.ino +++ b/examples/AltPinSerial/AltPinSerial.ino @@ -1,15 +1,20 @@ -#include #include // Simple tutorial on how to receive and send MIDI messages. // Here, when receiving any message on channel 4, the Arduino // will blink a led and play back a note for 1 second. -int rxPin = 18; -int txPin = 19; -SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin); -MIDI_NAMESPACE::SerialMIDI serialMIDI(mySerial); -MIDI_NAMESPACE::MidiInterface> MIDI((MIDI_NAMESPACE::SerialMIDI&)serialMIDI); +#if defined(ARDUINO_SAM_DUE) || defined(SAMD_SERIES) + /* example not relevant for this hardware */ + MIDI_CREATE_DEFAULT_INSTANCE(); +#else + #include + int rxPin = 18; + int txPin = 19; + SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin); + MIDI_NAMESPACE::SerialMIDI serialMIDI(mySerial); + MIDI_NAMESPACE::MidiInterface> MIDI((MIDI_NAMESPACE::SerialMIDI&)serialMIDI); +#endif void setup() {