Controls going on even after we let go of the button

In our code, we have out indexing and shooting set to a button that runs the motors when it is held. However when we tested it, we tap the button and the motor keeps on running after we let go. The only way to stop it is to disable the robot. Pictures or relevant code will be attached. GitHub: GitHub - ryszardo2019/2020Robot

You see how you have an if-else for your shifting transmission?

You need an if-else on the shoot & index function.

If you don’t explicitly tell the motor to stop at some condition with set(), it won’t stop.

3 Likes

Oh the stupid things you miss when coding at 3 in the morning. Thank you

It’s actually a pretty common mistake.

1 Like

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