User Manual

Continuous Rotation Servos
If you're using continuous servos, you can use the angle assignments and just remember that 0 is rotating one way, 90
is 'stopped' and 180 and rotating the other way. Or, better yet, you can use the crickit.continuous_servo_1 object
instead of the plain servo_1
Again, you get up to 4 servos. You can mix 'plain' and 'continuous' servos
If your continuous servo doesn't stop once the loop is finished you may need to tune the min_pulse and max_pulse
timings so that the center makes the servo stop. Or check if the servo has a center-adjustment screw you can tweak.
Disconnecting Servos or Custom Pulses
If you want to 'disconnect' the Servo by sending it 0-length pulses, you can do that by 'reaching in' and adjusting the
underlying PWM duty cycle with:
crickit.servo_1._pwm_out.duty_cycle = 0
or
crickit.servo_1._pwm_out.fraction = 0
import time
from adafruit_crickit import crickit
print("1 Servo demo with custom pulse widths!")
crickit.servo_1.set_pulse_width_range(min_pulse=500, max_pulse=2500)
while True:
print("Moving servo #1")
crickit.servo_1.angle = 0 # right
time.sleep(1)
crickit.servo_1.angle = 180 # left
time.sleep(1)
import time
from adafruit_crickit import crickit
print("1 Continuous Servo demo!")
while True:
crickit.continuous_servo_1.throttle = 1.0 # Forwards
time.sleep(2)
crickit.continuous_servo_1.throttle = 0.5 # Forwards halfspeed
time.sleep(2)
crickit.continuous_servo_1.throttle = 0 # Stop
time.sleep(2)
crickit.continuous_servo_1.throttle = -0.5 # Backwards halfspeed
time.sleep(2)
crickit.continuous_servo_1.throttle = -1 # Forwards
time.sleep(2)
crickit.continuous_servo_1.throttle = 0 # Stop
time.sleep(2)
© Adafruit Industries
https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-
construction-kit
Page 92 of 201