Files
Roboteksperimentarium/infinity_loop.py
NikolajDanger 8d9d93439c
2022-09-07 14:16:38 +02:00

36 lines
544 B
Python

from time import sleep
import robot
POWER = 127
TURN_T = 0.079 # 10 degrees
DRIVE_T = 0.22 # 10 centimeter
RIGHT_WHEEL_OFFSET = 4
CLOCKWISE_OFFSET = 0.82
def loop(arlo):
while True:
arlo.go_diff(POWER, 42, 1, 1)
sleep(DRIVE_T * 19)
arlo.go_diff(40, POWER, 1, 1)
sleep(DRIVE_T * 19)
arlo.stop()
def main():
# Initializes the robot and runs the
arlo = robot.Robot()
try:
loop(arlo)
except KeyboardInterrupt:
arlo.stop()
if __name__ == "__main__":
main()