Change IR Sensor, fix motor direction
This commit is contained in:
parent
77c2354c00
commit
a544133e92
2 changed files with 28 additions and 11 deletions
|
@ -39,11 +39,11 @@ class Motor(object):
|
|||
adjusted_speed = int(min(max(0, percent), 100) * MOTOR_PERCENTAGE_MULT)
|
||||
|
||||
if forward:
|
||||
pwm.setMotorPwm(port * 2, 0)
|
||||
pwm.setMotorPwm(port * 2 + 1, adjusted_speed)
|
||||
else:
|
||||
pwm.setMotorPwm(port * 2, adjusted_speed)
|
||||
pwm.setMotorPwm(port * 2 + 1, 0)
|
||||
else:
|
||||
pwm.setMotorPwm(port * 2, 0)
|
||||
pwm.setMotorPwm(port * 2 + 1, adjusted_speed)
|
||||
|
||||
@staticmethod
|
||||
def all_off():
|
||||
|
|
Reference in a new issue