What do you have so far? Also, is it like a situation where you are controlling the lift with other buttons/joysticks and the up and down buttons are purely for velocity control?
This doesn’t help if you are trying to learn how callbacks work but it is an alternative solution.
Add the latch variables before the while in your user control.
bool toggle = false;
bool latch = false;
while (1) {
//User control code ...
Then replace your “Untested Code” with this:
Drivetrain.setDriveVelocity(50,percent);
if (Controller1.ButtonUp.pressing()) {
if(!latch){ //flip the toggle one time and set the latch
toggle = !toggle;
latch = true;
}
} else {
latch = false;
}
if (toggle){
Lift1.setVelocity(10,percent);
Lift2.setVelocity(10,percent);
} else {
Lift1.setVelocity(50,percent);
Lift2.setVelocity(50,percent);
}