Hi camilozk
You are very patient with my suggestions. Tell me to stop if I am not helping ![]()
Let me go back to the original code you posted in the attachment. The midi function is writing three bytes of data to the serial port.
void MIDI_TX(unsigned char MESSAGE, unsigned char PITCH, unsigned char VELOCITY)
{
status = MESSAGE + midichannel;
Serial.write(status);
Serial.write(PITCH);
Serial.write(VELOCITY);
}
Are these actually going to a MIDI device and generating notes, or are you reading them on the serial monitor to see what is happening? If it is the second, maybe use print instead of write so you can see the decimal value rather than having special characters on the screen.
Also, in your first post you said
In the code you will see that the 3rd midi note stops when both sensors are again recibing light
In your original code, this was working ok?