esp32,esp8266: Add __len__ to NeoPixel driver to support iterating.
Signed-off-by: mishafarms <github@mishafarms.us>
This commit is contained in:
parent
2fa975c264
commit
b3a34dde36
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user