360 Servo¶

Description |
More commonly called a Continuous Rotation Servo. This servo can rotate 360 degrees. It operates continuously in the clockwise or counterclockwise direction. The servo does not have a concept of position. |
Usage |
Control the direction and speed by changing the duty cycle. Servo operates on a 20 ms cycle. 100% Clockwise Speed - set duty cycle 0.5 ms 0% Speed (Stopped) - set duty cycle 1.5 ms 100% Counterclockwise Speed - set duty cycle 2.5 ms |
Voltage Range |
3 - 5.5V |
Interface Type |
Analog Output |
Example Usage |
from microbit import *
pin0.set_analog_period(20) # 20 ms cycle
# 50% Speed Clockwise
pin0.write_analog(1023 * 1.0 / 20)
sleep(1000) # wait 1 second
# 50% Speed Counterclockwise
pin0.write_analog(1023 * 2.0 / 20)
sleep(1000) # wait 1 second
# Stopped
pin0.write_analog(1023 * 1.5 / 20)
sleep(1000) # wait 1 second
|