Skip to content
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

Allow for transformed PWMOut-based error #67

Merged
merged 4 commits into from
Jan 10, 2023
Merged

Allow for transformed PWMOut-based error #67

merged 4 commits into from
Jan 10, 2023

Conversation

tekktrik
Copy link
Member

@tekktrik tekktrik commented Jan 6, 2023

Fixes #66

@tekktrik tekktrik requested a review from a team January 6, 2023 06:00
Copy link
Contributor

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Good fix! One suggestion.

adafruit_motor/stepper.py Outdated Show resolved Hide resolved
Co-authored-by: Dan Halbert <halbert@halwitz.org>
@tekktrik tekktrik requested a review from dhalbert January 6, 2023 17:21
self._coil[i].frequency = 2000
else:
Copy link
Member

Choose a reason for hiding this comment

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

Won't this error fire if the frequency is above 1500 but not variable? Or do I misread it?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are absolutely correct, the logic should be inverted to use a guard clause instead for if under and not variable: raise error.

Thanks @jepler for catching the faulty logic!
@tekktrik tekktrik requested a review from jepler January 9, 2023 17:15
Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

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

That looks sensible now, thank you!

@jepler jepler dismissed dhalbert’s stale review January 9, 2023 17:53

suggestion implemented

@tekktrik tekktrik merged commit f2edb76 into adafruit:main Jan 10, 2023
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jan 10, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.13.1 from 1.13.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#80 from BiffoBear/dhcp_error_handling

Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 1.17.0 from 1.16.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#63 from FoamyGuy/png_typing_and_example
  > Add .venv to .gitignore
  > Update .pylintrc for v2.15.5
  > Fix release CI files
  > Update pylint to 2.15.5
  > Updated pylint version to 2.13.0
  > Switching to composite actions

Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 3.4.6 from 3.4.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_Motor#67 from tekktrik/pwmout-fix
  > Add .venv to .gitignore
  > Update .pylintrc for v2.15.5
  > Fix release CI files
  > Update pylint to 2.15.5
  > Updated pylint version to 2.13.0
  > Switching to composite actions

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.12.12 from 1.12.11:
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#124 from adafruit/chain-exception-when-fail
  > Add .venv to .gitignore

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
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.

Stepper motor assumes PWM pins are variable frequency
3 participants