From a421c881d976d0b29972f6caf053a35fe96db3c7 Mon Sep 17 00:00:00 2001 From: Jonas Wedin Date: Sat, 18 Apr 2015 12:20:10 +0000 Subject: [PATCH] Fixed inheritence in motor controller --- MotorController.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MotorController.py b/MotorController.py index 3bb690b..b318e1f 100644 --- a/MotorController.py +++ b/MotorController.py @@ -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 @@ -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