Change IR Sensor, fix motor direction

This commit is contained in:
Konstantin Lampalzer 2021-01-23 11:55:56 +00:00
parent 77c2354c00
commit a544133e92
2 changed files with 28 additions and 11 deletions

View file

@ -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():