Skip to content

Search the documentation

Kit
Firmware

Servo

Smart Car

A servo motor on one of the robot’s servo plugs; angles are in degrees, 0 to 180.

The Servo class is reached through these attributes of robot.

Can be None until you call robot.enable_servos().

Can be None until you call robot.enable_servos().

Can be None until you call robot.enable_servos().

Can be None until you call robot.enable_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.

Turns the servo to an angle from 0 to 180 degrees.

set_angle(degrees)

Used in examples: Servo arm and joystick

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