This class implements a servo driver for a position-controlled servo.
More...
|
| def | __init__ (self, str pwm_pin, int timer, int ch) |
| | Creates a servo driver and configures the appropriate pins, timers, and timer channels.
|
| |
|
def | return_to_zero (self) |
| | Returns the servo to the zero position.
|
| |
| def | set_position (self, int position) |
| | Sets the servo position based on the PWM level.
|
| |
|
|
| pwm_pin |
| | Pin object for PWM pin.
|
| |
|
| timer |
| | Timer object for the servo driver.
|
| |
|
| pwm |
| | Channel object for PWM channel.
|
| |
This class implements a servo driver for a position-controlled servo.
◆ __init__()
| def servo_driver.ServoDriver.__init__ |
( |
|
self, |
|
|
str |
pwm_pin, |
|
|
int |
timer, |
|
|
int |
ch |
|
) |
| |
Creates a servo driver and configures the appropriate pins, timers, and timer channels.
- Parameters
-
| pwm_pin | String containing the pin label of the PWM pin (e.g. 'A10' for pin A10) |
| timer | Number of the timer to configure, given as integer (e.g. 5 for TIM5) |
| ch | The channel number of the PWM pin, given as integer |
◆ set_position()
| def servo_driver.ServoDriver.set_position |
( |
|
self, |
|
|
int |
position |
|
) |
| |
Sets the servo position based on the PWM level.
- Parameters
-
| position | Degree angle to move the servo. Given as integer from -90 to 90 (inclusive). Overall range may vary depending on servo model. |
The documentation for this class was generated from the following file: