VS Code not following If Statements

I need help. For some reason, my Python code in Visual Studio is not working. Specifically, the code is not reading an if statement. It is spinning the motor but not following the rest of it. This is a recurring problem with all if statements I write. The picture is of a bare-bones code that is just the wiring, drivetrain, and the if statement issue. Any advice is appreciated.

please don’t ai generate responses @sweetspotmaster

though as the ai pointed out, you need to add parenthesis at the end of your function calls to make them actually work. you also probably meant to do pressing() instead of pressed(). the if statement should look like this:

if controller_1.buttonL1.pressing():
    ring_intake_motor.spin(FORWARD)
else:
    ring_intake_motor.stop()
8 Likes

That fixed it. Thank you so much. I can’t believe no one I’ve shown it too has caught that.

1 Like