Level down clean up
This commit is contained in:
@@ -8,7 +8,7 @@ motor_B2 = pwmio.PWMOut(board.GP19)
|
||||
|
||||
right_motor = motor_A1, motor_A2
|
||||
left_motor = motor_B1, motor_B2
|
||||
max_speed = 2**16-1
|
||||
max_speed = 2 ** 16 - 1
|
||||
|
||||
|
||||
def stop():
|
||||
@@ -25,7 +25,7 @@ def set_speed(motor, speed):
|
||||
speed = -speed
|
||||
else:
|
||||
direction = motor
|
||||
speed = min(speed, 1) # limit to 1.0
|
||||
speed = min(speed, 1) # limit to 1.0
|
||||
|
||||
direction[0].duty_cycle = int(max_speed * speed)
|
||||
direction[1].duty_cycle = 0
|
||||
|
||||
Reference in New Issue
Block a user