Skip to content

Commit d83ae84

Browse files
authored
Merge pull request #8 from FoamyGuy/len_pixels
Compatibility with LED_Animation library
2 parents 4a84676 + 2a05c95 commit d83ae84

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

adafruit_macropad.py

+3
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,9 @@ def __getitem__(self, index):
911911
def __repr__(self):
912912
return self._pixels.__repr__()
913913

914+
def __len__(self):
915+
return len(self._pixels)
916+
914917
@property
915918
def auto_write(self):
916919
"""
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SPDX-FileCopyrightText: 2021 Tim Cocks
2+
# SPDX-License-Identifier: MIT
3+
4+
"""
5+
This simpletest example displays the Blink animation on the
6+
MacroPad neopixels
7+
"""
8+
from adafruit_led_animation.animation.blink import Blink
9+
from adafruit_led_animation.color import BLUE
10+
from adafruit_macropad import MacroPad
11+
12+
macropad = MacroPad()
13+
14+
blink = Blink(macropad.pixels, speed=0.5, color=BLUE)
15+
16+
while True:
17+
blink.animate()

0 commit comments

Comments
 (0)