Allow seperate buffer with offset

This commit is contained in:
2026-02-19 17:53:57 +13:00
parent c062110e35
commit 2869ec9300
2 changed files with 6 additions and 4 deletions

View File

@@ -29,8 +29,10 @@ class WS2812B:
self.invert = invert
self.pio_dma = dma.PIO_DMA_Transfer(state_machine+4, state_machine, 8, num_leds*3)
def show(self):
self.pio_dma.start_transfer(self.ar)
def show(self, array=None, offset=0):
if array is None:
array = self.ar
self.pio_dma.start_transfer(array, offset)
def set(self, i, color):
self.ar[i*3] = int(color[1]*self.brightness)