I’ve coded our team’s bot to set the motors to brake type hold to avoid being pushed if the driver presses the down arrow button, but I can’t figure out how to make it stop holding either when the driver lets go or presses it again, like a toggle. This is my code so far, but it would prevent the bot from being driven:
The logic looks like it should work, I think the problems is that the stop function sets the motor speed to zero. I think the function you are looking for is setStopping, which doesn’t stop the motor but tells it how to behave when it does stop.