MCPcopy Create free account
hub / github.com/RetiredWizard/PyDOS / fill_buf

Method fill_buf

mpython/lib/optional/ws2812.py:138–151  ·  view source on GitHub ↗

Fill buffer with RGB data. All LEDs after the data are turned off.

(self, data)

Source from the content-addressed store, hash-verified

136 return index // 12
137
138 def fill_buf(self, data):
139 """
140 Fill buffer with RGB data.
141
142 All LEDs after the data are turned off.
143 """
144 end = self.update_buf(data)
145
146 # turn off the rest of the LEDs
147 buf = self.buf
148 off = self.buf_bytes[0]
149 for index in range(end * 12, self.buf_length):
150 buf[index] = off
151 index += 1

Callers 1

showMethod · 0.95

Calls 1

update_bufMethod · 0.95

Tested by

no test coverage detected