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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions adafruit_seesaw/neopixel.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,21 @@ def __init__(
pin,
n,
*,
bpp=3,
bpp=None,
brightness=1.0,
auto_write=True,
pixel_order=None
):
# TODO: brightness not yet implemented.
self._seesaw = seesaw
self._pin = pin
self._bpp = bpp
self.auto_write = auto_write
self._n = n
self._brightness = min(max(brightness, 0.0), 1.0)
self._pixel_order = GRBW if pixel_order is None else pixel_order
self._bpp = len(self._pixel_order) if bpp is None else bpp
if self._bpp != len(self._pixel_order):
raise ValueError("Pixel order and bpp value do not agree.")

cmd = bytearray([pin])
self._seesaw.write(_NEOPIXEL_BASE, _NEOPIXEL_PIN, cmd)
Expand Down