The Motor Diver Class.
More...
|
| | __init__ (self, PWM, DIR, nSLP, timer, ch) |
| | Motor Initialization.
|
| | set_effort (self, effort) |
| | Set Effort Sets the present effort requested from the motor based on an input value between -100 and 100.
|
| | enable (self) |
| | Enable Enables the motor driver by taking it out of sleep mode into brake mode.
|
| | disable (self) |
| | Disable Disables the motor driver by taking it into sleep mode.
|
|
| | nSLP = Pin(nSLP, mode=Pin.OUT_PP, value=0) |
| | dir = Pin(DIR, mode=Pin.OUT_PP, value=0) |
| | timCH = timer.channel(ch, pin=PWM, mode=Timer.PWM, pulse_width_percent=0) |
The Motor Diver Class.
A motor driver interface encapsulated in a Python class. Works with motor drivers using separate PWM and direction inputs such as the DRV8838 drivers present on the Romi chassis from Pololu.
Definition at line 8 of file motor.py.
◆ __init__()
| motor.Motor.__init__ |
( |
| self, |
|
|
| PWM, |
|
|
| DIR, |
|
|
| nSLP, |
|
|
| timer, |
|
|
| ch ) |
◆ disable()
| motor.Motor.disable |
( |
| self | ) |
|
Disable Disables the motor driver by taking it into sleep mode.
Definition at line 37 of file motor.py.
◆ enable()
| motor.Motor.enable |
( |
| self | ) |
|
Enable Enables the motor driver by taking it out of sleep mode into brake mode.
Definition at line 32 of file motor.py.
◆ set_effort()
| motor.Motor.set_effort |
( |
| self, |
|
|
| effort ) |
Set Effort Sets the present effort requested from the motor based on an input value between -100 and 100.
Definition at line 22 of file motor.py.
◆ dir
| motor.Motor.dir = Pin(DIR, mode=Pin.OUT_PP, value=0) |
◆ nSLP
| motor.Motor.nSLP = Pin(nSLP, mode=Pin.OUT_PP, value=0) |
◆ timCH
| motor.Motor.timCH = timer.channel(ch, pin=PWM, mode=Timer.PWM, pulse_width_percent=0) |
The documentation for this class was generated from the following file: