Skip to content

Make things tunable via kwargs #22

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 3 commits into from
Sep 9, 2020

Conversation

caternuson
Copy link
Collaborator

For #19 and as another option to #20 and #21. This approach uses kwargs instead of properties.

This will allow for "tuning" of the underlying timings for better support of other flavor addressable RGBs. There are four parameters (new kwargs) that are involved:

  • frequency - The SPI bus frequency, really only two values that matter. Added as an init parameter.
  • reset_time - The reset time value (TRST). Added as a new property.
  • bit0 - The byte that defines timing for a 0 bit (T0H+T0L). Added as a new property.
  • bit1 -The byte that defines timing for a 1 bit (T1H+T1L). Added as a new property.

This example shows tweaking the bit 1 pattern which may work for the case discussed in #19 and #20:

$ python3
Python 3.6.9 (default, Jul 17 2020, 12:50:27) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import neopixel_spi as neopixel
>>> pixels = neopixel.NeoPixel_SPI(board.SPI(), 1, pixel_order=neopixel.RGB, bit1=0b11111000)
>>> pixels.fill(0xADAF00)
>>> 

@caternuson caternuson mentioned this pull request Sep 8, 2020
@caternuson
Copy link
Collaborator Author

@geekmomprojects Can you test this PR's approach as well? No reason why it shouldn't work since it's just a different approach for setting things up.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thank you!

@geekmomprojects
Copy link

Late to the party, but it works great for me. Thank you!

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Sep 10, 2020
@caternuson caternuson mentioned this pull request Sep 10, 2020
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