30 lines
617 B
Python
30 lines
617 B
Python
from time import sleep
|
|
import robot
|
|
|
|
DRIVE_A = 5.3 # 10 degrees turn at power 1
|
|
TURN_A = 16 # 10 centimeter drive at power 1
|
|
|
|
RIGHT_WHEEL_OFFSET = 4
|
|
|
|
def main():
|
|
# Gets the power for the robot
|
|
power = input("Power (64):")
|
|
if power == "":
|
|
power = 64
|
|
else:
|
|
power = int(power)
|
|
|
|
# Calculates sleep times for the robot
|
|
turn_t = DRIVE_A / power # 10 degrees turn at given power
|
|
|
|
# Initializes the robot and runs the
|
|
arlo = robot.Robot()
|
|
|
|
arlo.go_diff(power, power + RIGHT_WHEEL_OFFSET, 1, 0)
|
|
sleep(turn_t * 36)
|
|
arlo.stop()
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|