if(Controller1.ButtonR1.pressing()){
Elevator.spin(directionType::fwd,42,velocityUnits::pct);
}
else if(Controller1.ButtonR2.pressing()){
Elevator.spin(directionType::rev,80,velocityUnits::pct);
}
else{
Elevator.stop(brakeType::brake);
}
I want to try to program the ramp to the ButtonDown & Up as a fast move but I want to program it to ButtonUp & Down as a slower version. Is it possible to do and how would you do it, cuz I tried it but it cancels each other out.
Add more else if conditions to this to handle the other buttons. The big key is having only a single spin
command get executed in any given loop.
we fixed the problem by changing the ramp to the right joystick so we can control it with the joystick
So your’e trying to make it so it goes fast if you hit down, then up, and slow if you hit up then down? I’m confused
If so, just add another if statement
if(Controller1.ButtonR1.pressing()){
if(Controller1.ButtonR2.pressing()){
Elevator.spin(directionType::fwd,42,velocityUnits::pct);
}}
2 Likes
I already fixed it but the problem about ur method is that it cancels each other out