Skip to content

Update parameter docs #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions adafruit_motor/servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
class _BaseServo: # pylint: disable-msg=too-few-public-methods
"""Shared base class that handles pulse output based on a value between 0 and 1.0

:param ~pulseio.PWMOut pwm_out: PWM output object.
:param int min_pulse: The minimum pulse length of the servo in microseconds.
:param int max_pulse: The maximum pulse length of the servo in microseconds.
:param int range: The physical range of the servo corresponding to the signal's duty in
degrees."""
:param int max_pulse: The maximum pulse length of the servo in microseconds."""
def __init__(self, pwm_out, *, min_pulse=1000, max_pulse=2000):
self._min_duty = int((min_pulse * pwm_out.frequency) / 1000000 * 0xffff)
max_duty = (max_pulse * pwm_out.frequency) / 1000000 * 0xffff
Expand All @@ -60,11 +59,11 @@ def _fraction(self, value):
class Servo(_BaseServo):
"""Control the position of a servo.

:param ~pulseio.PWMOut pwm_out: PWM output object.
:param int actuation_range: The physical range of the servo corresponding to the signal's
duty in degrees.
:param int min_pulse: The minimum pulse length of the servo in microseconds.
:param int max_pulse: The maximum pulse length of the servo in microseconds.
:param int trim: Slight shift of values to calibrate stopped value in microseconds."""
:param int max_pulse: The maximum pulse length of the servo in microseconds."""
def __init__(self, pwm_out, *, actuation_range=180, min_pulse=1000, max_pulse=2000):
super().__init__(pwm_out, min_pulse=min_pulse, max_pulse=max_pulse)
self._actuation_range = actuation_range
Expand All @@ -85,8 +84,7 @@ class ContinuousServo(_BaseServo):
"""Control a continuous rotation servo.

:param int min_pulse: The minimum pulse length of the servo in microseconds.
:param int max_pulse: The maximum pulse length of the servo in microseconds.
:param int trim: Slight shift of values to calibrate stopped value in microseconds."""
:param int max_pulse: The maximum pulse length of the servo in microseconds."""
@property
def throttle(self):
"""How much power is being delivered to the motor. Values range from ``-1.0`` (full
Expand Down