This class implements a motor driver for an ME405 kit.
More...
|
def | __init__ (self, en_pin, in1pin, in2pin, timer) |
| Creates a motor driver by initializing GPIO pins and turning the motor off for safety. More...
|
|
def | set_duty_cycle (self, duty) |
| This method sets the duty cycle to be sent to the motor to the given level. More...
|
|
This class implements a motor driver for an ME405 kit.
◆ __init__()
def motor_clephan_mcgrath.MotorDriver.__init__ |
( |
|
self, |
|
|
|
en_pin, |
|
|
|
in1pin, |
|
|
|
in2pin, |
|
|
|
timer |
|
) |
| |
Creates a motor driver by initializing GPIO pins and turning the motor off for safety.
- Parameters
-
en_pin | enables the motor driver |
in1pin | is the pin number associated with channel 2 of the motor |
in2pin | is the pin number associated with channel 1 of the motor |
◆ set_duty_cycle()
def motor_clephan_mcgrath.MotorDriver.set_duty_cycle |
( |
|
self, |
|
|
|
duty |
|
) |
| |
This method sets the duty cycle to be sent to the motor to the given level.
Positive values cause torque in one direction, negative values in the opposite direction.
- Parameters
-
level | A signed integer holding the duty cycle of the voltage sent to the motor |
The documentation for this class was generated from the following file: