Controller Button acting different!

Hello,
My team has just finished our official robot and I was running some code on it for the elevator. The button i had set was acting weird. On the old robot if I put

if (stick->GetRawButton(3))
{
ElevatorMotors(0.3);
}

And I press the button 3 it would do the command as long as I held the button down. Once I let go it would stop. Though for some reason on the new robot if I press it and let go, it still does the command. If I disable the robot, the command stops. But if I re-enable it, the command will continue even if I haven’t touched the button. Help would be greatly appreciated. I want to see how to get it back to how it was originally.

It’s going to be very difficult to help you without your actual code. It’s best if you can put it on GitHub and share a link with us, but any method of sharing is better than nothing.

Without seeing the rest of your code (and we really do need that), I can only assume you need some code to stop the motor.

if (stick->GetRawButton(3))
{
    ElevatorMotors(0.3);
}
else {
    ElevatorMotors(0);
}
1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.