Skip to content

Make duty_cycle return the same value it was set to... #53

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
May 22, 2023

Conversation

DrRob
Copy link
Contributor

@DrRob DrRob commented May 2, 2023

...albeit with the least significant four bits set to zero (the device only uses the most significant twelve bits and doesn't store the remaining four, so these will be lost).

Also set the special bit for "fully off" instead of setting the LEDn_ON and LEDn_OFF registers to the same value, as instructed in the datasheet.

DrRob added 2 commits May 2, 2023 22:01
…least significant

four bits set to zero (the device only uses the most significant twelve bits and doesn't
store the remaining four, so these will be lost).

Also set the special bit for "fully off" instead of setting the LEDn_ON and LEDn_OFF
registers to the same value, as instructed in the datasheet.
@tekktrik tekktrik linked an issue May 3, 2023 that may be closed by this pull request
@tekktrik tekktrik requested a review from a team May 3, 2023 17:03
@dhalbert
Copy link
Contributor

Could someone test the "fully off" fix on a PCA9685 board?

@DrRob
Copy link
Contributor Author

DrRob commented May 11, 2023

Could someone test the "fully off" fix on a PCA9685 board?

BTW, setting the duty_cycle value to zero was already turning the output fully off, but doing so in a way contrary to the guidance in the datasheet, which is why I changed that part as well.

I've tested with an oscilloscope on one of the PCA9685 outputs and it does turn the output fully off. (It would make sense for someone else to verify that, of course.)

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.

This looks fine. If you tested it in hardware, that's fine!

@dhalbert dhalbert merged commit 4589f15 into adafruit:main May 22, 2023
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 27, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO055 to 5.4.10 from 5.4.9:
  > Reformatted per pre-commit
  > Update .pylintrc, fix jQuery for docs
  > Update pre-commit hooks

Updating https://github.com/adafruit/Adafruit_CircuitPython_INA260 to 1.3.13 from 1.3.12:
  > Merge pull request adafruit/Adafruit_CircuitPython_INA260#26 from adafruit/dev/fix-pylint-jquery
  > Merge pull request adafruit/Adafruit_CircuitPython_INA260#25 from tekktrik/dev/fix-pylint
  > Update pre-commit hooks
  > Add upload url to release action
  > Add .venv to .gitignore

Updating https://github.com/adafruit/Adafruit_CircuitPython_Nunchuk to 1.1.8 from 1.1.7:
  > Update .pylintrc, fix jQuery for docs
  > Run pre-commit
  > Update pre-commit hooks
  > Merge pull request adafruit/Adafruit_CircuitPython_Nunchuk#34 from adafruit/thirdparty_nunchuk
  > Add upload url to release action

Updating https://github.com/adafruit/Adafruit_CircuitPython_PCA9685 to 3.4.10 from 3.4.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_PCA9685#56 from adafruit/dev/fix-plyint-jquery
  > Merge pull request adafruit/Adafruit_CircuitPython_PCA9685#53 from DrRob/fix-duty-cycle

Updating https://github.com/adafruit/Adafruit_CircuitPython_Seesaw to 1.13.0 from 1.12.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#117 from kattni/add-gamepad-qt
  > Update .pylintrc, fix jQuery for docs
  > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#115 from adafruit/ano_rotary_examples

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.12.14 from 2.12.13:
  > Update .pylintrc, fix jQuery for docs
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#80 from DJDevon3/WorkingBranch

Updating https://github.com/adafruit/Adafruit_CircuitPython_Debouncer to 2.0.6 from 2.0.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_Debouncer#42 from tekktrik/dev/move-hw-unittest
  > Update .pylintrc, fix jQuery for docs
  > Update pre-commit hooks
  > Add upload url to release action
  > 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_MacroPad to 2.2.1 from 2.2.0:
  > Update .pylintrc, fix jQuery for docs
  > Run pre-commit
  > Update pre-commit hooks
  > Merge pull request adafruit/Adafruit_CircuitPython_MacroPad#46 from kalehmann/fix-45/wake-display-during-init

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.

duty_cycle getter doesn't return what setter was given
2 participants