diff --git a/adafruit_macropad.py b/adafruit_macropad.py index 2843374..9b74e1c 100755 --- a/adafruit_macropad.py +++ b/adafruit_macropad.py @@ -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): """ diff --git a/examples/macropad_led_animation_example.py b/examples/macropad_led_animation_example.py new file mode 100644 index 0000000..bc0c5be --- /dev/null +++ b/examples/macropad_led_animation_example.py @@ -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()