Add more flesh to the motor file
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user