Hello everyone. I've made a midi controller using a leonardo board and everything works perfectly fine when the arduino app is open but as soon as I close the app the board starts to send the updated potentiometer positions at a rate of one every second or so to my DAW. I have no idea why that is. also I am using both the MIDIUSB library by Gary Grewal and the MIDI library by Francois Best.
Please post your full sketch, using code tags when you do
What do you mean when you refer to your "arduino app" ?
If you disconnect the board from the PC (after it was first connected) the board can't get rid of all the printed data.
You need to check if there is space in the software buffer before you send. You can use if(Serial.availableForWrite() to check if there is enough space to print; e.g.
if(Serial.availableForWrite() > 60)
{
Serial.print("Track volume control switched to: ");
}
The value 60 is arbitrarily chosen.
If you want you board to work without the PC connected, you can get rid of the while(!Serial) or modify it and add a timeout.
commenting all of my serial commands fixed the issue. now it works whether the arduino IDE is running in the background or not.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.