rewrote AltPinSerial to use SoftwareSerial

This commit is contained in:
lathoub 2020-04-20 13:08:49 +02:00 committed by GitHub
parent 9d43a8370e
commit 1e14162bf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 13 deletions

View File

@ -1,12 +1,15 @@
#include <SoftwareSerial.h>
#include <MIDI.h>
#include "altPinSerialMIDI.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.
AltSerialMIDI<HardwareSerial> serialMIDI(Serial1, 18, 19);
MIDI_NAMESPACE::MidiInterface<AltSerialMIDI<HardwareSerial>> MIDI((AltSerialMIDI<HardwareSerial>&)serialMIDI);
int rxPin = 18;
int txPin = 19;
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
MIDI_NAMESPACE::SerialMIDI<SoftwareSerial> serialMIDI(mySerial);
MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<HardwareSerial>> MIDI((MIDI_NAMESPACE::SerialMIDI<HardwareSerial>&)serialMIDI);
void setup()
{