File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 1- #include < SoftwareSerial.h>
21#include < MIDI.h>
32
43// Simple tutorial on how to receive and send MIDI messages.
54// Here, when receiving any message on channel 4, the Arduino
65// will blink a led and play back a note for 1 second.
76
8- int rxPin = 18 ;
9- int txPin = 19 ;
10- SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
11- MIDI_NAMESPACE::SerialMIDI<SoftwareSerial> serialMIDI (mySerial);
12- MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<SoftwareSerial>> MIDI ((MIDI_NAMESPACE::SerialMIDI<SoftwareSerial>&)serialMIDI);
7+ #if defined(ARDUINO_SAM_DUE) || defined(SAMD_SERIES)
8+ /* example not relevant for this hardware */
9+ MIDI_CREATE_DEFAULT_INSTANCE ();
10+ #else
11+ #include < SoftwareSerial.h>
12+ int rxPin = 18 ;
13+ int txPin = 19 ;
14+ SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
15+ MIDI_NAMESPACE::SerialMIDI<SoftwareSerial> serialMIDI (mySerial);
16+ MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<SoftwareSerial>> MIDI ((MIDI_NAMESPACE::SerialMIDI<SoftwareSerial>&)serialMIDI);
17+ #endif
1318
1419void setup ()
1520{
You can’t perform that action at this time.
0 commit comments