diff options
Diffstat (limited to 'esp8266')
-rw-r--r-- | esp8266/scripts/neopixel.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/esp8266/scripts/neopixel.py b/esp8266/scripts/neopixel.py index 6b7541e64a..8aa0348680 100644 --- a/esp8266/scripts/neopixel.py +++ b/esp8266/scripts/neopixel.py @@ -20,5 +20,12 @@ class NeoPixel: i = index * 3 return self.buf[i + 1], self.buf[i], self.buf[i + 2] + def fill(self, color): + r, g, b = color + for i in range(len(self.buf) / 3): + self.buf[i * 3] = g + self.buf[i * 3 + 1] = r + self.buf[i * 3 + 2] = b + def write(self): neopixel_write(self.pin, self.buf, True) |