Using Serial.print together with the midi library?

hi

Is there a way to use the Serial.print function in a project that also uses the midi library? They have different baud rates 9600 vs. 31250.

The baud rate of the Serial monitor can be changed, of course, but which Arduino board are you using as many have only one hardware serial port.

yep, my Arduino UNO has only one serial port, so I guess it’s either the one or the other, unless there is a way to change the baud rate with code, e.g. use two buttons to switch the baud rate at run time.

You can call Serial.begin() again to change the baud rate. What you can't change, programmaticly, is what is listening to the serial port.

The Serial Monitor does not have to operate at 9600 baud. There are many other rates it can operate at. I'm too lazy to see if 31250 is a supported rate.

If you use 31250 as the baud rate Serial.print will give you weird characters.

If you use 31250 as the baud rate Serial.print will give you weird characters.

Not if you select the same rate in the Serial Monitor. Oh, wait, you can't.

So, no, you can't send data to a midi device and the serial monitor at the same time.

this inability to use Serial.print in midi projects makes debugging harder, unless there is a workaround.

Any good ? http://arduino.cc/en/Tutorial/SoftwareSerial

looks interesting, thanks

I wonder if I could do a loopback, i.e. connect the output pin 7 to the input pin 6....

I wonder if I could do a loopback, i.e. connect the output pin 7 to the input pin 6....

You can. But, it won't work.

why?

Because SoftwareSerial is only half duplex ?