Untitled

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

yVariable = 2

def when_started1():

global myVariable

drivetrain.set_drive_velocity(50, PERCENT)

while True:

while (not location.position(X, MM) > 1000 and not location.position(X, MM) < -1000 and not
location.position(Y, MM) > 1000 and not location.position(Y, MM) < -1000):

if front_distance.get_distance(MM) > 2000:

drivetrain.turn_for(RIGHT, 5, DEGREES)

drivetrain.drive(FORWARD)

wait(5, MSEC)

drivetrain.stop()

drivetrain.drive_for(REVERSE, 50, MM)

drivetrain.turn_to_heading((drivetrain.heading(DEGREES) + 30), DEGREES)

drivetrain.drive_for(FORWARD, 50, MM)

wait(5, MSEC)

vr_thread(when_started1)

You might also like