Skip to content

Search the documentation

Kit
Firmware

Servo

Smart Home

The house’s servo motor (the door); angles are in degrees, 0 to 180.

The Servo class is reached through this attribute of home.

Always there.

All the attributes of home are in its table.

The angle last set, in degrees from 0 to 180.

angle: int

Read only.

Used in examples: Hello, house

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

set_angle(angle)

Used in examples: Doorbell

Turns the servo slowly to an angle (0 to 180 degrees), step degrees every delay_ms milliseconds.

move_to(angle, step: int, delay_ms: int)

You can leave out step and delay_ms.

Used in examples: Hello, house

Turns the servo to the middle, 90 degrees.

center()

Used in examples: Hello, house

Swings the servo from start to end degrees and back, cycles times, step degrees every delay_ms milliseconds.

sweep(start: int, end: int, step: int, delay_ms: int, cycles: int)

You can leave out start, end, step, delay_ms and cycles.

Used in examples: Hello, house

Turns the servo to its smallest angle (0 degrees unless the house set another limit).

move_to_min()

Used in examples: Hello, house

Turns the servo to its largest angle (180 degrees unless the house set another limit).

move_to_max()

Used in examples: Hello, house