Skip to content

Commit 2956dda

Browse files
committed
Add createPixelSubStrip to allow access to PixelSubStrips
Signed-off-by: David Greaves <[email protected]>
1 parent eb6e167 commit 2956dda

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

library/rpi_ws281x/rpi_ws281x.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,17 @@ def show(self):
173173
str_resp = ws.ws2811_get_return_t_str(resp)
174174
raise RuntimeError('ws2811_render failed with code {0} ({1})'.format(resp, str_resp))
175175

176+
def createPixelSubStrip(self, first, last=None, num=None):
177+
"""Create a PixelSubStrip starting with pixel `first`
178+
Either specify the `num` of pixels or the `last` pixel.
179+
180+
All the methods of a PixelSubStrip are available on PixelStrip
181+
objects.
182+
183+
Note: PixelSubStrips are not prevented from overlappping
184+
"""
185+
return self.PixelSubStrip(self, first, last=last, num=num)
186+
176187

177188
class PixelSubStrip:
178189
"""A PixelSubStrip handles a subset of the pixels in a PixelStrip

0 commit comments

Comments
 (0)