This commit is contained in:
NikolajDanger
2022-09-07 09:20:32 +02:00
parent a2de78ca72
commit c52cb9b2ba

View File

@ -1,15 +1,27 @@
from time import sleep
import robot
POWER = 64
TURN_TIME = 0.75
DRIVE_TIME = 2.5
def main():
arlo = robot.Robot()
turn_time = 3
left_speed = 64
right_speed = 64
print(arlo.go_diff(left_speed, right_speed, 1, 1))
sleep(turn_time)
print(arlo.stop())
try:
while True:
# Driving forward
arlo.go_diff(POWER, POWER, 1, 1)
sleep(DRIVE_TIME)
arlo.stop()
# Turning 90 degrees
arlo.go_diff(POWER, POWER, 1, 0)
sleep(TURN_TIME)
arlo.stop()
except KeyboardInterrupt:
arlo.stop()
if __name__ == "__main__":