Skip to content

Commit

Permalink
Set scaled speed to zero when speed is zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
masasin committed Sep 10, 2015
1 parent bd583f6 commit a8a80da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rpi/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ def _scale_speed(self, speed):
scaled_speed = (speed * (1 - self.start_input)) + self.start_input
elif speed < 0:
scaled_speed = (speed * (1 - self.start_input)) - self.start_input
else:
scaled_speed = 0

# Map [0:1] to [0:max_speed]
scaled_speed *= self.max_speed
Expand Down

0 comments on commit a8a80da

Please sign in to comment.