User Manual
Likewise you can set the duty cycle to a custom value with
crickit.servo_1._pwm_out.duty_cycle =
number
where
number
is between 0 (off) and 65535 (fully on). For example, setting it to 32767 will be 50% duty cycle, at the
50 Hz update rate
Or you can use fractions like crickit.servo_1._pwm_out.fraction = 0.5
import time
from adafruit_crickit import crickit
print("1 Servo release demo!")
while True:
print("Moving servo #1")
crickit.servo_1.angle = 0 # right
time.sleep(10)
print("Released")
crickit.servo_1._pwm_out.duty_cycle = 0
time.sleep(10)
# and repeat!
© Adafruit Industries
https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-
construction-kit
Page 93 of 201










