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

Method show

mpython/lib/optional/ws2812.py:71–81  ·  view source on GitHub ↗

Show RGB data on LEDs. Expected data = [(R, G, B), ...] where R, G and B are intensities of colors in range from 0 to 255. One RGB tuple for each LED. Count of tuples may be less than count of connected LEDs.

(self, data)

Source from the content-addressed store, hash-verified

69 self.show(self._rgblist)
70
71 def show(self, data):
72 """
73 Show RGB data on LEDs. Expected data = [(R, G, B), ...] where R, G and B
74 are intensities of colors in range from 0 to 255. One RGB tuple for each
75 LED. Count of tuples may be less than count of connected LEDs.
76 """
77 for i in range(min(len(data),self.led_count)):
78 self.__setitem__(i,data[i])
79
80 self.fill_buf(data)
81 self.send_buf()
82
83 def send_buf(self):
84 """

Callers 2

__init__Method · 0.95
writeMethod · 0.95

Calls 3

__setitem__Method · 0.95
fill_bufMethod · 0.95
send_bufMethod · 0.95

Tested by

no test coverage detected