Ch-5 clean

This commit is contained in:
Danny Staple
2022-03-20 22:24:56 +00:00
parent 5c4ecaeb13
commit 481cac28de
8 changed files with 14 additions and 9 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
import time
import robot
max_speed = 2**16-1
max_speed = 2 ** 16 - 1
robot.motor_A1.duty_cycle = int(0.8 * max_speed)
time.sleep(0.3)
robot.stop()
robot.stop()
+2 -2
View File
@@ -4,8 +4,8 @@ import pwmio
A1_PWM = pwmio.PWMOut(board.GP17)
A1_PWM.duty_cycle = 2**16-1
A1_PWM.duty_cycle = 2 ** 16 - 1
time.sleep(0.3)
A1_PWM.duty_cycle = 2**15
A1_PWM.duty_cycle = 2 ** 15
time.sleep(0.3)
A1_PWM.duty_cycle = 0
+2 -2
View File
@@ -3,8 +3,8 @@ import robot
try:
for speed in range(5, 10):
robot.set_left(speed/10)
robot.set_right(speed/10)
robot.set_left(speed / 10)
robot.set_right(speed / 10)
time.sleep(0.3)
finally:
robot.stop()