Servos¶
raspbot.actuators.servo.Servo
raspbot.actuators.servo.ServoPair
Controls the pan/tilt servo channels of the Raspbot V2 via I2C register 0x02.
| Servo | Channel | Range |
|---|---|---|
| PAN (horizontal) | 1 | 0 - 180 deg |
| TILT (vertical) | 2 | 0 - 110 deg (hardware limit) |
Access via Robot.servos (a ServoPair).
Servo¶
Constructor¶
Properties¶
max_angle¶
Maximum allowed angle for this servo (180 for PAN, 110 for TILT).
Methods¶
set_angle(angle)¶
Move the servo to angle degrees.
The value is clamped to [0, max_angle] automatically.
| Parameter | Type | Description |
|---|---|---|
angle |
int |
Target angle in degrees |
home()¶
Move the servo to 90 degrees (centre position).
ServoPair¶
Convenience wrapper that manages both pan and tilt servos together.
This is what Robot.servos exposes.
Constructor¶
Attributes¶
| Attribute | Type | Description |
|---|---|---|
pan |
Servo |
PAN servo (channel 1, 0-180 deg) |
tilt |
Servo |
TILT servo (channel 2, 0-110 deg) |
Methods¶
home()¶
Move both servos to their default positions: pan to 90 deg, tilt to 25 deg.