turn_test.py
This commit is contained in:
27
turn_test.py
Normal file
27
turn_test.py
Normal file
@ -0,0 +1,27 @@
|
||||
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
|
||||
|
||||
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, 1, 0)
|
||||
sleep(turn_t * 360)
|
||||
arlo.stop()
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
main()
|
Reference in New Issue
Block a user