Skip to content

Make microseconds_to_angle() consistent with simpleio.Servo() #32

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 2 commits into from
Aug 15, 2018
Merged

Make microseconds_to_angle() consistent with simpleio.Servo() #32

merged 2 commits into from
Aug 15, 2018

Conversation

ScottDWebster
Copy link
Contributor

  • simpleio.Servo() allows for the fine tuning of pulse length via
    min_pulse and max_pulse but microseconds_to_angle() formerly
    ignored those values and used hard coded ones.
  • That would lead to an inaccurate conversion if fine tuning had
    been used.
  • This patch makes use of self.min_pulse and self.max_pulse in
    order to make correct use of any fine tuning specified during
    object instantiation.

- simpleio.Servo() allows for the fine tuning of pulse length via
min_pulse and max_pulse but microseconds_to_angle() formerly
ignored those values and used hard coded ones.
- That would lead to an inaccurate conversion if fine tuning had
been used.
- This patch makes use of self.min_pulse and self.max_pulse in
order to make correct use of any fine tuning specified during
object instantiation.
Docstring erroneously stated that units were in  microseconds when they
were in fact milliseconds.  This patch corrects that.
@tannewt tannewt requested a review from brentru August 14, 2018 17:53
Copy link
Member

@brentru brentru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good patch for finer control for the microseconds_to_angle method. I feel tuning with pulse width is the right move.

@tannewt tannewt merged commit 54766df into adafruit:master Aug 15, 2018
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 3, 2018
Updating https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground to 2.0.3 from 2.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#41 from caternuson/iss40
  > ignore the board module imports in .pylintrc
  > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#38 from kattni/pylint-fix
  > updated CoC

Updating https://github.com/adafruit/Adafruit_CircuitPython_HCSR04 to 0.3.3 from 0.3.2:
  > Try a new encrypted password

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIDARLite to 1.1.0 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIDARLite#2 from kattni/pypi-setup

Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90614 to 1.1.0 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90614#9 from kattni/pypi-setup
  > ignore the board module imports in .pylintrc
  > updated CoC

Updating https://github.com/adafruit/Adafruit_CircuitPython_TCA9548A to 0.1.1 from 0.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_TCA9548A#3 from kattni/pypi-setup

Updating https://github.com/adafruit/Adafruit_CircuitPython_miniQR to 1.1.0 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_miniQR#3 from kattni/pypi-setup

Updating https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO to 1.1.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_SimpleIO#36 from caternuson/iss35
  > Merge pull request adafruit/Adafruit_CircuitPython_SimpleIO#34 from brentru/remove-servo
  > Merge pull request adafruit/Adafruit_CircuitPython_SimpleIO#32 from ScottDWebster/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants