Skip to content

Improve performance with (optional, disabled by default) manual sync #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 2 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
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: 6 additions & 0 deletions adafruit_neotrellis/multitrellis.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ def sync(self):
x = int(evt.number % 4) + _m * 4
_t.callbacks[evt.number](x, y, evt.edge)

def show(self):
"""Show the colors on the NeoPixels"""
for _n in range(self._rows):
for _m in range(self._cols):
self._trelli[_n][_m].show()

@property
def brightness(self):
"""The NeoPixel brightness level of all clustered NeoTrellis boards."""
Expand Down
6 changes: 6 additions & 0 deletions adafruit_neotrellis/neotrellis.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def __init__(
addr=_NEO_TRELLIS_ADDR,
drdy=None,
brightness=1.0,
auto_write=True,
):
super().__init__(i2c_bus, addr, drdy)
self.interrupt_enabled = interrupt
Expand All @@ -77,6 +78,7 @@ def __init__(
_NEO_TRELLIS_NUM_KEYS,
brightness=self._brightness,
pixel_order=GRB,
auto_write=auto_write,
)

def activate_key(self, key, edge, enable=True):
Expand All @@ -103,6 +105,10 @@ def sync(self):
):
self.callbacks[evt.number](evt)

def show(self):
"""Show the NeoPixels on the Trellis"""
self.pixels.show()

@property
def brightness(self):
"""The NeoPixel brightness level of the board."""
Expand Down