nav_algo.servo module¶
-
class
nav_algo.servo.
servo
(tailPin, sailPin)¶ Bases:
object
-
SAIL_MAX
= 180¶
-
SAIL_MAX_ANGLE
= 148¶
-
SAIL_MIN
= 0¶
-
SAIL_MIN_ANGLE
= 0¶
-
TAIL_MAX
= 180¶
-
TAIL_MAX_ANGLE
= 60¶
-
TAIL_MIN
= 0¶
-
TAIL_MIN_ANGLE
= 0¶
-
mapRange
(val, min, max, endMin, endMax)¶ Returns value based on a linear map of MIN -> MAX to a value ENDMIN -> ENDMAX
-
readEncoder
()¶
-
setSail
(sail_angle)¶ Just instantiate the class then enter an angle into “servo”_angle as an int SAIL_MIN_ANGLE -> SAIL_MAX_ANGLE degrees
-
setTail
(tail_angle)¶ Just instantiate the class then enter an angle into “servo”_angle as an int TAIL_MIN_ANGLE -> TAIL_MAX_ANGLE degrees
-
sleepServo
(sleep)¶ Puts the servo driver to sleep to conserve energy.
- Parameters
sleep (bool) – turns off oscillator if True, if false it runs in normal operation.
-