Skip to content

Switch to properties instead of weird functions. #6

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

Closed
tannewt opened this issue Oct 13, 2017 · 0 comments · Fixed by #8
Closed

Switch to properties instead of weird functions. #6

tannewt opened this issue Oct 13, 2017 · 0 comments · Fixed by #8
Assignees

Comments

@tannewt
Copy link
Member

tannewt commented Oct 13, 2017

This driver has the MicroPython-ism of a setter/getter function where its a getter when values are None and setter when they are not. This is not Pythonic and confusing.

Instead, this API should be changed so that it has a number of channels that act like pulseio.PWMOut with frequency and duty_cycle as properties. frequency of each channel would be read only because its shared amongst all channels. The outer class can have an adjustable frequency property.

@tannewt tannewt self-assigned this Jan 6, 2018
tannewt added a commit to tannewt/Adafruit_CircuitPython_PCA9685 that referenced this issue Jan 6, 2018
This change reduces the scope of the PCA9685 driver to simply
providing PWMOut compatible objects for each channel. As a result,
the motor and servo can now be used with any PWM source, not just
the PCA9685. The new motor library is here:
https://github.com/adafruit/Adafruit_CircuitPython_Motor

Furthermore, this library is not aware of particular output configs
such as the specific Adafruit Motor FeatherWing. That knowledge has
been moved to a new FeatherWing library that handles all wing
related initialization. Its available here:
https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing

Lastly, the new driver code and examples have been linted and
standard library files added.

Fixes adafruit#6 and fixes adafruit#7.
tannewt added a commit that referenced this issue Jan 10, 2018
This change reduces the scope of the PCA9685 driver to simply
providing PWMOut compatible objects for each channel. As a result,
the motor and servo can now be used with any PWM source, not just
the PCA9685. The new motor library is here:
https://github.com/adafruit/Adafruit_CircuitPython_Motor

Furthermore, this library is not aware of particular output configs
such as the specific Adafruit Motor FeatherWing. That knowledge has
been moved to a new FeatherWing library that handles all wing
related initialization. Its available here:
https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing

Lastly, the new driver code and examples have been linted and
standard library files added.

Fixes #6 and fixes #7.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant