Vex IQ controller lag

At our robotics lab, we experienced a significant amount of controller lag, about 2-3 seconds. We tested multiple things, but the only thing that worked was commenting everything except for our drive loop out.

def when_started3():

global myVariable, my_event, claw, console_thingy, Fl4, l3l4, screen_precision, console_precision

while True:

    if Fl4:

        drivetrain.drive(FORWARD)

        left_drive_smart.set_velocity((controller.axisA.position()\*0.9 + controller.axisC.position() \* 0.27), PERCENT)



        right_drive_smart.set_velocity((controller.axisA.position()\*0.9 - controller.axisC.position() \* 0.27), PERCENT)

    wait(20, MSEC)

Your wait command is outside of the if statement.

If your whole code was done like this here, then you’d literally be telling the code to wait a bunch of times in a row, which adds up. - Try moving your wait commands inside of their cooresponding if statements, so that they only trigger if that condition actually happened.