So I am trying to make variable BlueLeft equal 1 if a certain part of the screen is pressed during driver control so that in autonomous, I can see if BlueLeft = 1 so that it would run the BlueLeft auton. I tried to just make the robot move to see if I was doing it correctly, and it gave me a syntax error. In the pre-auton section, I set both BlueLeft and RedRight to 0. If anybody could help me understand why “if BlueLeft = 1: then do this” won’t work then I would appreciate it immensely.
# GUI Functions
if brain.screen.pressing(): brain.screen.draw_circle(brain.screen.x_position(),brain.screen.y_position(),16) brain.screen.render() sys.sleep(1) if brain.screen.y_position() > 10 and brain.screen.y_position() < 110 and brain.screen.x_position() > 30 and brain.screen.x_position < 130: BlueLeft = 1 elif brain.screen.y_position() > 120 and brain.screen.y_position < 220 and brain.screen.x_position() > 360 and brain.screen.y_position < 460: RedRight = 1 if BlueLeft = 1: TrayMotor.spin(DirectionType.FWD,80,VelocityUnits.PCT)
For reference, I am programming this in Python using RMS