summaryrefslogtreecommitdiff
path: root/atmel-samd/modules
diff options
context:
space:
mode:
authorScott Shawcroft <scott@chickadee.tech>2016-11-11 12:45:32 -0800
committerScott Shawcroft <scott.shawcroft@gmail.com>2016-11-18 16:17:56 -0800
commit6e30b8ea9249d796cad440e84e92db280de8a911 (patch)
tree0afce49905c446021583b65a03a2122da8e5acbd /atmel-samd/modules
parent84edec4fad653b914ea2a3b56f0bc5c0548a68e4 (diff)
atmel-samd: Move neopixel out of internal flash.
Diffstat (limited to 'atmel-samd/modules')
-rw-r--r--atmel-samd/modules/neopixel.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/atmel-samd/modules/neopixel.py b/atmel-samd/modules/neopixel.py
deleted file mode 100644
index dba1e4aea..000000000
--- a/atmel-samd/modules/neopixel.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# NeoPixel driver for MicroPython on ESP8266
-# MIT license; Copyright (c) 2016 Damien P. George
-
-from neopixel_write import neopixel_write
-
-class NeoPixel:
- def __init__(self, pin, n):
- self.pin = pin
- self.n = n
- self.buf = bytearray(n * 3)
- self.pin.init(pin.OUT)
-
- def __setitem__(self, index, val):
- r, g, b = val
- self.buf[index * 3] = g
- self.buf[index * 3 + 1] = r
- self.buf[index * 3 + 2] = b
-
- def __getitem__(self, index):
- 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)