Commit b3a34dde authored by Michael Weiss's avatar Michael Weiss Committed by Damien George

esp32,esp8266: Add __len__ to NeoPixel driver to support iterating.

Signed-off-by: default avatarmishafarms <github@mishafarms.us>
parent 2fa975c2
......@@ -15,6 +15,9 @@ class NeoPixel:
self.pin.init(pin.OUT)
self.timing = timing
def __len__(self):
return self.n
def __setitem__(self, index, val):
offset = index * self.bpp
for i in range(self.bpp):
......
......@@ -15,6 +15,9 @@ class NeoPixel:
self.pin.init(pin.OUT)
self.timing = timing
def __len__(self):
return self.n
def __setitem__(self, index, val):
offset = index * self.bpp
for i in range(self.bpp):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment