Skip to content

Fix incorrect RGBW NeoPixel output #102

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 1 commit into from
Jun 11, 2022
Merged

Conversation

caternuson
Copy link
Contributor

Simple fix for #101.

This works:

Adafruit CircuitPython 7.2.5 on 2022-04-06; Adafruit Feather M4 Express with samd51j19
>>> import board
>>> from adafruit_seesaw import seesaw, neopixel
>>> ss = seesaw.Seesaw(board.I2C())
>>> pixels = neopixel.NeoPixel(ss, 20, 12, pixel_order=neopixel.GRBW)
>>> pixels.fill(0xFF0000)
>>> 

This also works (assumes RGBW pixel order):

Adafruit CircuitPython 7.2.5 on 2022-04-06; Adafruit Feather M4 Express with samd51j19
>>> import board
>>> from adafruit_seesaw import seesaw, neopixel
>>> ss = seesaw.Seesaw(board.I2C())
>>> pixels = neopixel.NeoPixel(ss, 20, 12, bpp=4)
>>> pixels.fill(0xFF0000)
>>> 

Trying to over specify incompatible values throws exception:

Adafruit CircuitPython 7.2.5 on 2022-04-06; Adafruit Feather M4 Express with samd51j19
>>> import board
>>> from adafruit_seesaw import seesaw, neopixel
>>> ss = seesaw.Seesaw(board.I2C())
>>> pixels = neopixel.NeoPixel(ss, 20, 12, bpp=3, pixel_order=neopixel.GRBW)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lib/adafruit_seesaw/neopixel.py", line 78, in __init__
ValueError: Pixel order and bpp value do not agree.
>>> 

@caternuson caternuson requested a review from a team June 8, 2022 00:17
Copy link
Member

@tekktrik tekktrik left a comment

Choose a reason for hiding this comment

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

Elegant fix!

@tekktrik tekktrik merged commit 1230da9 into adafruit:main Jun 11, 2022
@ladyada
Copy link
Member

ladyada commented Jun 11, 2022

thanks @caternuson i didnt get to look till now!

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