From e038fc9c89705103db5d6810a925f66a9b83b786 Mon Sep 17 00:00:00 2001 From: Robert Wolterman Date: Mon, 7 Aug 2017 21:24:15 -0500 Subject: [PATCH] actually finishing servo api docs --- docs/servo.md | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/docs/servo.md b/docs/servo.md index 1fa8a98..594ae31 100644 --- a/docs/servo.md +++ b/docs/servo.md @@ -35,4 +35,97 @@ Function to report to the calling script if the SBC is a CHIP or a CHIP Pro is_chip_pro = UT.is_chip_pro() ``` +### start(channel, angle=0.0, range=180.0) +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 + + ```python + SERVO.start("CSID0") + SERVO.start("CSID0", 37.0) + SERVO.start("CSID0", -45.0, 180.0) + ``` + +### stop(channel) +Stop the Servo + +* Parameters + + channel - Pin servo is attached to + +* Returns + + None + +* Examples + + ```python + SERVO.stop("CSID0") + ``` + +### set_range(channel, range) +Set the range of the Servo + +* Parameters + + channel - Pin servo is attached to + range - total range of the servo in degrees + +* Returns + + None + +* Examples + + ```python + SERVO.set_range("CSID0", 180.0) + SERVO.set_range("CSID0", 360.0) + ``` + +### set_angle(channel, angle) +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 + + ```python + SERVO.set_angle("CSID0", -45.0) + SERVO.set_angle("CSID0", 36.0) + ``` + +### cleanup() +Cleanup all setup Servos, this will blast away every sero currently in operation + +* Parameters + + None + +* Returns + + None + +* Examples + + ```python + SERVO.cleanup() + ``` + [home](./index.md)