Need Help on error

So I may be having an aneurism right now, but I have no idea why I am getting a invalid syntax error for my code.

This is the code:

if controller_1.buttonL1.pressing():
motor_group_4.set_velocity(200,RPM) #a motor group allows for the two motors to spin easily
motor_group_4.spin(FORWARD) #This sets the motors to do their current direction
else:
motor_group_4.stop() #This allows for the motors to stop

The system is telling me there is an error at the beginning of the if statement with the colon.
If you can please help i’d be grateful.

What language are you programming in?

You should probably do something like this if you are coding in V5 Pro Text:
if (controller_1.ButtonL1.pressing()) {
motor_group_4.setVelocity(200,RPM);
motor_group_4.spin(fwd);
}
else {
motor_group_4.stop(hold);
}
If this doesn’t work, try switching out the “controller_1” to the default “Controller1”. I don’t know about the “motor_group_4”, but if that’s what you defined it as it should be fine.

3 Likes

I found out my problem it was due to the fact that I left out a parenthesis in an earlier line. I love python

3 Likes