pyb.Servo
Classes
Create a servo object. |
Module Contents
- class pyb.Servo.Servo(id)
Create a servo object.
idis 1-4, and corresponds to pins X1 through X4.- angle(angle: Any | None = None, time=0) Incomplete
If no arguments are given, this function returns the current angle.
If arguments are given, this function sets the angle of the servo:
angleis the angle to move to in degrees.timeis the number of milliseconds to take to get to the specified angle. If omitted, then the servo moves as quickly as possible to its new position.
- calibration(pulse_min, pulse_max, pulse_centre, pulse_angle_90, pulse_speed_100) Tuple
If no arguments are given, this function returns the current calibration data, as a 5-tuple.
If arguments are given, this function sets the timing calibration:
pulse_minis the minimum allowed pulse width.pulse_maxis the maximum allowed pulse width.pulse_centreis the pulse width corresponding to the centre/zero position.pulse_angle_90is the pulse width corresponding to 90 degrees.pulse_speed_100is the pulse width corresponding to a speed of 100.
- pulse_width(value: Any | None = None) Incomplete
If no arguments are given, this function returns the current raw pulse-width value.
If an argument is given, this function sets the raw pulse-width value.
- speed(speed: Any | None = None, time=0) Incomplete
If no arguments are given, this function returns the current speed.
If arguments are given, this function sets the speed of the servo:
speedis the speed to change to, between -100 and 100.timeis the number of milliseconds to take to get to the specified speed. If omitted, then the servo accelerates as quickly as possible.