Example not relevant for Due and ZERO as they lack support for SoftwareSerial
This commit is contained in:
parent
e06e3677f0
commit
05487c5415
|
|
@ -1,15 +1,20 @@
|
||||||
#include <SoftwareSerial.h>
|
|
||||||
#include <MIDI.h>
|
#include <MIDI.h>
|
||||||
|
|
||||||
// Simple tutorial on how to receive and send MIDI messages.
|
// Simple tutorial on how to receive and send MIDI messages.
|
||||||
// Here, when receiving any message on channel 4, the Arduino
|
// Here, when receiving any message on channel 4, the Arduino
|
||||||
// will blink a led and play back a note for 1 second.
|
// will blink a led and play back a note for 1 second.
|
||||||
|
|
||||||
int rxPin = 18;
|
#if defined(ARDUINO_SAM_DUE) || defined(SAMD_SERIES)
|
||||||
int txPin = 19;
|
/* example not relevant for this hardware */
|
||||||
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
|
MIDI_CREATE_DEFAULT_INSTANCE();
|
||||||
MIDI_NAMESPACE::SerialMIDI<SoftwareSerial> serialMIDI(mySerial);
|
#else
|
||||||
MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<SoftwareSerial>> MIDI((MIDI_NAMESPACE::SerialMIDI<SoftwareSerial>&)serialMIDI);
|
#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()
|
void setup()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue