A CHIP IO library for Python: IO+PWM+SPWM+ADC+Utilities
Import the SERVO module as follows
import CHIP_IO.SERVO as SERVO
Enable/Disable the Debug
Parameters
None
Examples
SERVO.toggle_debug()
Function to report to the calling script if the SBC is a CHIP or a CHIP Pro
Parameters
None
Returns
int - 1 for CHIP Pro, 0 for CHIP
Examples
is_chip_pro = SERVO.is_chip_pro()
Start the Servo
Parameters
channel - Pin servo is attached to angle - initial angle of the servo (optional) range - total range of the servo in degrees (optional)
Returns
None
Examples
SERVO.start("CSID0")
SERVO.start("CSID0", 37.0)
SERVO.start("CSID0", -45.0, 180.0)
Stop the Servo
Parameters
channel - Pin servo is attached to
Returns
None
Examples
SERVO.stop("CSID0")
Set the range of the Servo
Parameters
channel - Pin servo is attached to range - total range of the servo in degrees
Returns
None
Examples
SERVO.set_range("CSID0", 180.0)
SERVO.set_range("CSID0", 360.0)
Set the angle of the Servo
Parameters
channel - Pin servo is attached to angle - angle to set the servo between +/- 1/2*Range
Returns
None
Examples
SERVO.set_angle("CSID0", -45.0)
SERVO.set_angle("CSID0", 36.0)
Cleanup all setup Servos, this will blast away every sero currently in operation
Parameters
None
Returns
None
Examples
SERVO.cleanup()