Example not relevant for Due and ZERO as they lack support for SoftwareSerial

This commit is contained in:
lathoub 2020-04-20 14:11:58 +02:00 committed by GitHub
parent e06e3677f0
commit 05487c5415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 6 deletions

View File

@ -1,15 +1,20 @@
#include <SoftwareSerial.h>
#include <MIDI.h>
// 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.
#if defined(ARDUINO_SAM_DUE) || defined(SAMD_SERIES)
/* example not relevant for this hardware */
MIDI_CREATE_DEFAULT_INSTANCE();
#else
#include <SoftwareSerial.h>
int rxPin = 18;
int txPin = 19;
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
MIDI_NAMESPACE::SerialMIDI<SoftwareSerial> serialMIDI(mySerial);
MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<SoftwareSerial>> MIDI((MIDI_NAMESPACE::SerialMIDI<SoftwareSerial>&)serialMIDI);
#endif
void setup()
{