Hello!
I'm new to the forum, and attempting to trigger midi notes using an FSR. In hairless debug, I'm receiving the error:
Warning: got a status byte when we were expecting 1 more data bytes, sending possibly incomplete MIDI message 0x90
and:
Warning: got a status byte when we were expecting 2 more data bytes, sending possibly incomplete MIDI message 0xa2
I've read the other post about this, and changed the baud to 115200. Didn't help. Setting flow control to XON/XOFF seems to help for 80% of these errors. It is sending the notes, but It keeps crashing hairless. Any help would be appreciated ![]()
Code:
//credit to thedude77 & rogue
int fsrC = 0; //FSR is on pin 0
int fsrVal = 0; //variable for reading FSR value
int mappedFsrVal = 0; //variable for holding remapped FSR value
void setup() {
Serial.begin(115200); //MIDI communicates at 31250 baud
}
void loop(){
fsrVal = analogRead(fsrC); //read input from FSR
mappedFsrVal = map(fsrVal, 0, 127, 0, 127); //map value to 0-127
if(analogRead(fsrC)){
midiOUT(0xB0, 6, mappedFsrVal); //CC Volume message
midiOUT(0x90, 60, mappedFsrVal); //MIDI noteOn message/Ply Middle C
prevFsrVal = mappedFsrVal;
delay(250);
}
}
void midiOUT(char command, char value1, char value2) {
Serial.print(command);
Serial.print(value1);
Serial.print(value2);
}