Skip to content

Commit 859dffd

Browse files
committed
change default servo pulse range from 1000-2000 to 550-2400
1 parent 6da5d14 commit 859dffd

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

adafruit_motor/servo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class _BaseServo: # pylint: disable-msg=too-few-public-methods
4040
:param ~pulseio.PWMOut pwm_out: PWM output object.
4141
:param int min_pulse: The minimum pulse length of the servo in microseconds.
4242
:param int max_pulse: The maximum pulse length of the servo in microseconds."""
43-
def __init__(self, pwm_out, *, min_pulse=1000, max_pulse=2000):
43+
def __init__(self, pwm_out, *, min_pulse=550, max_pulse=2400):
4444
self._min_duty = int((min_pulse * pwm_out.frequency) / 1000000 * 0xffff)
4545
max_duty = (max_pulse * pwm_out.frequency) / 1000000 * 0xffff
4646
self._duty_range = int(max_duty - self._min_duty)
@@ -64,7 +64,7 @@ class Servo(_BaseServo):
6464
duty in degrees.
6565
:param int min_pulse: The minimum pulse length of the servo in microseconds.
6666
:param int max_pulse: The maximum pulse length of the servo in microseconds."""
67-
def __init__(self, pwm_out, *, actuation_range=180, min_pulse=1000, max_pulse=2000):
67+
def __init__(self, pwm_out, *, actuation_range=180, min_pulse=550, max_pulse=2400):
6868
super().__init__(pwm_out, min_pulse=min_pulse, max_pulse=max_pulse)
6969
self._actuation_range = actuation_range
7070
self._pwm = pwm_out

examples/continuous_servo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
# pca = PCA9685(i2c, reference_clock_speed=25630710)
2020
pca.frequency = 50
2121

22-
# The pulse range is 1000 - 2000 by default.
22+
# The pulse range is 550 - 2400 by default.
2323
servo7 = servo.ContinuousServo(pca.channels[7])
2424
# If your servo doesn't stop once the script is finished you may need to tune the
2525
# reference_clock_speed above or the min_pulse and max_pulse timings below.
26-
# servo7 = servo.ContinuousServo(pca.channels[7], min_pulse=1000, max_pulse=2000)
26+
# servo7 = servo.ContinuousServo(pca.channels[7], min_pulse=550, max_pulse=2400)
2727

2828
print("Forwards")
2929
servo7.throttle = 1

examples/servo_sweep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# This is an example for the Micro servo - TowerPro SG-92R: https://www.adafruit.com/product/169
3434
# servo7 = servo.Servo(pca.channels[7], min_pulse=500, max_pulse=2400)
3535

36-
# The pulse range is 1000 - 2000 by default.
36+
# The pulse range is 550 - 2400 by default.
3737
servo7 = servo.Servo(pca.channels[7])
3838

3939
# We sleep in the loops to give the servo time to move into position.

0 commit comments

Comments
 (0)