Servo
Overview
The servo has a rotation range of 0-180°, accepts precise control, and can rotate to a specified angle.
Technical Specifications
Operating voltage: VCC 3.3V -5V
Rotation angle: 0-180 degrees
Operating torque: 1.6KG/CM
Response speed: 0.12-0.13/60°
Pin Definition
Pin |
Definition |
|---|---|
Black(GND) |
Ground |
Red(VCC) |
Power |
Yellow(DI) |
Control signal input |
Example Code
Make the servo swing left and right continuously
from mpython import *
from servo import Servo
import time
servo_15 = Servo(15, min_us=500, max_us=2500, actuation_range=270)
while True:
servo_15.write_angle(60)
time.sleep(1)
servo_15.write_angle(120)
time.sleep(1)