Fixed sign for motor power
This commit is contained in:
parent
e0600d75c4
commit
60f252c37a
1 changed files with 6 additions and 1 deletions
|
@ -80,7 +80,12 @@ class Motor(object):
|
|||
:param percent: Percentage of max speed. between -100 and 100
|
||||
:raises: IndexError
|
||||
"""
|
||||
Motor.power_raw(port, Motor.__linearizePower(MOTOR_CURVE, percent))
|
||||
if percent > 0:
|
||||
Motor.power_raw(port, Motor.__linearizePower(MOTOR_CURVE, percent))
|
||||
elif percent < 0:
|
||||
Motor.power_raw(port, -Motor.__linearizePower(MOTOR_CURVE, -percent))
|
||||
else:
|
||||
Motor.power_raw(port, 0)
|
||||
|
||||
@staticmethod
|
||||
def all_off():
|
||||
|
|
Reference in a new issue