hey guys, so i have 2 buttons, one does program changes up and the other is program changes down, one interval at a time.
the problem is this:
lets say i am on program 10
i press program down, it goes to 9, press again it goes to 8.
now i want to go back up to program 9
i press program up and it will go down to 7, press again 8, press again 9.
then if i press program down it will go up one before going down and so on.
hopefully that makes sense.
i am using AlphaBeta's button library for the unique press function.
this is the section of code in question.
Button progUp = Button(11,PULLUP); //program up pin 11
Button progDn = Button(12,PULLUP); //program up pin 12
int prog = 114;
if(progUp.uniquePress()){
MIDI.send(PC,prog++,0,1);
}
if(progDn.uniquePress()){
MIDI.send(PC,prog--,0,1);
}
*note that is not the entire sketch, just the button assignment and loop section.