Hi, so i am putting together a simple midi controller that will be sending midi notes on and off with switches.
The problem i always run in to is how to to get the button to just send one "off" command with the else function.
Using the Button Library it is easy to send just on "on" command with the uniquePress function.
But then the problem is when the button is not being pressed the else function is in effect and it constantly sends out a note off message over and over and over...
I need it to just send one note off message when i release the button.
Thank you for the help, i tried adding those lines.
When the button is pressed it instantly sends the note on then note off message (before i let go of the button). I am pretty sure that is because of the uniquePress function in the Button Library.
when i change uniquePress to isPressed (as shown below) it will send out multiple on messages while the button is pressed and then when it is released it sends out just the one off message.
So now the off function is working great, i just need to stop the on message from being sent over and over.
thanks coding,
the new version works, but playing the note quickly gives unreliable results. it seems to work every time if i wait maybe a half a second between pushes.
the previous sketch seems to work flawlessly even with very rapid button pushes.