Servo
Smart CarA servo motor on one of the robot’s servo plugs; angles are in degrees, 0 to 180.
How you reach it
Section titled “How you reach it”The Servo class is reached through these attributes of robot.
robot.servo1
Section titled “robot.servo1”Can be None until you call robot.enable_servos().
robot.servo2
Section titled “robot.servo2”Can be None until you call robot.enable_servos().
robot.servo3
Section titled “robot.servo3”Can be None until you call robot.enable_servos().
robot.servo4
Section titled “robot.servo4”Can be None until you call robot.enable_servos().
robot.servos
Section titled “robot.servos”A list of Servo objects; each item can be None. Can be None until you call robot.enable_servos().
All the attributes of robot are in its table. Read Attributes that can be None to see when a part is None.
Methods
Section titled “Methods”set_angle(degrees)
Section titled “set_angle(degrees)”Turns the servo to an angle from 0 to 180 degrees.
set_angle(degrees)Used in examples: Servo arm and joystick
center()
Section titled “center()”Turns the servo to the middle, 90 degrees.
center()Used in examples: Servo arm and joystick
Stops sending pulses, so the servo no longer holds its position.
off()Used in examples: Servo arm and joystick