From e600dfea611786fb7ebc88bc76adbf8996d2ddc4 Mon Sep 17 00:00:00 2001 From: Michael Pivato Date: Mon, 7 Jan 2019 14:23:06 +1030 Subject: [PATCH] Add more flesh to the motor file --- MotorControl/motor.py | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/MotorControl/motor.py b/MotorControl/motor.py index e0cebb8..132757c 100644 --- a/MotorControl/motor.py +++ b/MotorControl/motor.py @@ -9,9 +9,6 @@ the motor on the Traxxas Slash using a Raspberry Pi 3B+. """ -""" - -""" class MotorController: def __init__(self, pin_number, frequency, duty_cycle=0): self._duty_cycle = duty_cycle @@ -35,7 +32,7 @@ class MotorController: if value > 0 and value < 100: self._duty_cycle = value # Change the current duty cycle of the GPIO. - self.control.changeDutyCycle + self._control_pin.changeDutyCycle def start(self): if self._running: @@ -47,9 +44,29 @@ class MotorController: self._control_pin.stop() def arm(self): + # Set pulse width 0 + + + # Wait 1s + + # Set pulse width to maximum + + # Wait 1s + + # set pulse width minimum + + # Wait 1s + + # Set pulse width to idle + + pass + + def setThrottle(self, throttle: float): + pass class MotorDetails: def __init__(self): + pass @property def minDutyCycle(self): @@ -71,8 +88,12 @@ class MotorDetails: def idle(self): return self._idle + @idle.setter + def idle(self, value): + self._idle = value +class Connection: + def __init__(self): + pass -max_reverse = 1000 -idle = 1500 -max_forward = 2000 + \ No newline at end of file