Commit 592b2927 authored by Mihir Garimella's avatar Mihir Garimella
Browse files

Motor driver fix

parent c6ff0e86
...@@ -32,7 +32,7 @@ class DirectionalMotor: ...@@ -32,7 +32,7 @@ class DirectionalMotor:
self.up_high_output.value = speed >= 0.0 self.up_high_output.value = speed >= 0.0
self.down_high_output.value = not self.up_high_output.value self.down_high_output.value = not self.up_high_output.value
speed = ( speed = abs(
speed * (self.max_duty_cycle - self.min_duty_cycle) + self.min_duty_cycle speed * (self.max_duty_cycle - self.min_duty_cycle) + self.min_duty_cycle
) )
self.motor.duty_cycle = int(speed * 32767) self.motor.duty_cycle = int(speed * 32767)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment