Serial output is garbled

Arduino UNO :Serial output will be garbled when using "MIDI.begin (MIDI_CHANNEL_OFF);" .

#include <MIDI.h>


MIDI_CREATE_DEFAULT_INSTANCE();

void setup() {
  Serial.begin(9600);  
    
  Serial.println("11223366554");
  Serial.flush();
  MIDI.begin (MIDI_CHANNEL_OFF); //start midi
}

void loop()
{
  while (!Serial){delay(20);} 
  
  Serial.println("Hello Word!");
  Serial.flush();
  delay(500);
  Serial.println("This is Arduino Uno.");
  Serial.flush();
}

and monitor output like that: "⸮d⸮a⸮⸮⸮Loed⸮a⸮⸮⸮Loed⸮a⸮⸮Hed⸮a⸮⸮H..."

Serial output is garbled

Please post your sketch and Serial monitor output in code tags rather than a video of something happening

Suspect the MIDI library uses the defaults serial port (pins 0 & 1).

Try using Software Serial for the MIDI communication.

Think you very much!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.