Skip to content

Commit

Permalink
Fixed inheritence in motor controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ztime committed Apr 18, 2015
1 parent c2acd47 commit a421c88
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions MotorController.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self, enablePin, in1pin, in2pin, direction="forward", boardmode="BC
elif(direction == self.REVERSE):
self.direction = self.REVERSE
else:
super(MotorController, self).cleanup()
raise ValueError('%s not allowed, use "forward" or "reverse"' % direction)
self.enablePin = enablePin
self.in1pin = in1pin
Expand Down Expand Up @@ -65,9 +66,9 @@ def stop(self):
io.output(self.in1pin, 0)
io.output(self.in2pin, 0)

def cleanup(self):
self.pwm.stop()
io.cleanup()
# def cleanup(self):
# self.pwm.stop()
# io.cleanup()

# takes a value from 0 -> 100 and scales it
# with DEFAULT_MAX
Expand Down

0 comments on commit a421c88

Please sign in to comment.