The DRV8847_channel class is used to set the duty cycle of an individual motor connected to the DRV8847 board. More...
Public Member Functions | |
| def | __init__ (self, INx_pin, INx_ch, INy_pin, INy_ch, INxy_timer) |
| A method to initialize a DRV8847_channel object. More... | |
| def | set_level (self, level) |
| A method to set the duty cycle of the motor. More... | |
Public Attributes | |
| timer | |
| The pyb.Timer object used to generate PWM for the motor. | |
| IN1 | |
| The channel of the PWM timer corresponding to the first motor lead. | |
| IN2 | |
| The channel of the PWM timer corresponding to the second motor lead. | |
The DRV8847_channel class is used to set the duty cycle of an individual motor connected to the DRV8847 board.
DRV8847_channel objects should only be used in conjunction with the DRV8847 class and should be instantiated by calling DRV8847.channel() instead of DRV8847_channel()
| def ME405_FP_DRV8847.DRV8847_channel.__init__ | ( | self, | |
| INx_pin, | |||
| INx_ch, | |||
| INy_pin, | |||
| INy_ch, | |||
| INxy_timer | |||
| ) |
A method to initialize a DRV8847_channel object.
Do not call this method directly using DRV8847_channel(), instead use DRV8847.channel() from an already initialized DRV8847 object.
| def ME405_FP_DRV8847.DRV8847_channel.set_level | ( | self, | |
| level | |||
| ) |
A method to set the duty cycle of the motor.
| duty | The duty cycle to set the motor to, from -100 to 100. |