1
1
# The MIT License (MIT)
2
2
#
3
- # Copyright (c) 2019 Kattni Rembor for Adafruit Industries
3
+ # Copyright (c) 2019 Roy Hooper
4
4
#
5
5
# Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
# of this software and associated documentation files (the "Software"), to deal
47
47
from . import NANOS_PER_SECOND , monotonic_ns
48
48
49
49
50
- class AggregatePixels :
50
+ class PixelMap :
51
51
"""
52
- AggregatePixels lets you treat ranges of pixels as single pixels for animation purposes.
52
+ PixelMap lets you treat ranges of pixels as single pixels for animation purposes.
53
53
54
54
:param strip: An object that implements the Neopixel or Dotstar protocol.
55
55
:param iterable pixel_ranges: Pixel ranges (or individual pixels).
@@ -59,10 +59,10 @@ class AggregatePixels:
59
59
60
60
import board
61
61
import neopixel
62
- from adafruit_led_animation.helper import AggregatePixels
62
+ from adafruit_led_animation.helper import PixelMap
63
63
pixels = neopixel.NeoPixel(board.D12, 307, auto_write=False)
64
64
65
- tree = AggregatePixels (pixels, [
65
+ tree = PixelMap (pixels, [
66
66
(0, 21), (21, 48), (48, 71), (71, 93),(93, 115), (115, 135), (135, 153),
67
67
(153, 170), (170, 188), (188, 203), (203, 217), (217, 228), (228, 240),
68
68
(240, 247), (247, 253), (253, 256), (256, 260), (260, 307)]
@@ -135,7 +135,7 @@ def brightness(self, brightness):
135
135
def fill (self , color ):
136
136
"""
137
137
Fill the used pixel ranges with color.
138
- :param color: Color to fill all pixels referenced by this AggregatePixels definition with.
138
+ :param color: Color to fill all pixels referenced by this PixelMap definition with.
139
139
"""
140
140
if self ._individual_pixels :
141
141
for pixels in self ._ranges :
@@ -163,9 +163,9 @@ def auto_write(self, value):
163
163
self ._pixels .auto_write = value
164
164
165
165
166
- class SubsetPixels :
166
+ class PixelSubset :
167
167
"""
168
- SubsetPixels lets you work with a subset of a pixel object.
168
+ PixelSubset lets you work with a subset of a pixel object.
169
169
170
170
:param strip: An object that implements the Neopixel or Dotstar protocol.
171
171
:param int start: Starting pixel number.
@@ -175,11 +175,11 @@ class SubsetPixels:
175
175
176
176
import board
177
177
import neopixel
178
- from adafruit_led_animation.helper import SubsetPixels
178
+ from adafruit_led_animation.helper import PixelSubset
179
179
pixels = neopixel.NeoPixel(board.D12, 307, auto_write=False)
180
180
181
181
star_start = 260
182
- star_arm = SubsetPixels (pixels, star_start + 7, star_start + 15)
182
+ star_arm = PixelSubset (pixels, star_start + 7, star_start + 15)
183
183
star_arm.fill((255, 0, 255))
184
184
pixels.show()
185
185
"""
0 commit comments