Skip to content

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