I tried to get this code working:
If I use usbMIDI, everything works fine, but not on Serial2: The Midi connector is connected to pin 8 (TX2) via 47 R, GND and VCC via 47R. There are no short-circuits (anymore) and there is activity on the output. But the signal is not recognized by the MIDI receiver (I tried 3 different ones).I also checked, that the DIN connector is correctly wired. Any ideas?
Code:
#include <MIDI.h>
MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, MIDI);
const int channel = 1;
void setup() {
MIDI.begin();
}
void loop() {
int note;
for (note=10; note <= 127; note++) {
MIDI.sendNoteOn(note, 100, 2);
delay(200);
MIDI.sendNoteOff(note, 100, 2);
}
delay(2000);
}
Last edited: