Skip to content

Compatibility with LED_Animation library #8

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
Jul 17, 2021
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
3 changes: 3 additions & 0 deletions adafruit_macropad.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,9 @@ def __getitem__(self, index):
def __repr__(self):
return self._pixels.__repr__()

def __len__(self):
return len(self._pixels)

@property
def auto_write(self):
"""
Expand Down
17 changes: 17 additions & 0 deletions examples/macropad_led_animation_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SPDX-FileCopyrightText: 2021 Tim Cocks
# SPDX-License-Identifier: MIT

"""
This simpletest example displays the Blink animation on the
MacroPad neopixels
"""
from adafruit_led_animation.animation.blink import Blink
from adafruit_led_animation.color import BLUE
from adafruit_macropad import MacroPad

macropad = MacroPad()

blink = Blink(macropad.pixels, speed=0.5, color=BLUE)

while True:
blink.animate()