diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-05-12 17:57:23 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-05-12 17:57:23 +0300 |
commit | e9308c189af388525becbcd42b81ea6d37738135 (patch) | |
tree | 9976c0b87b77e06ae40c52443f2c0d1e0acce7ad /esp8266/modules/apa102.py | |
parent | 5f7ce2a1ca65840ef95d0c044088bc38453b7471 (diff) | |
download | micropython-e9308c189af388525becbcd42b81ea6d37738135.tar.gz micropython-e9308c189af388525becbcd42b81ea6d37738135.zip |
esp8266/scripts: Move drivers/modules to modules/ (frozen bytecode).
Diffstat (limited to 'esp8266/modules/apa102.py')
-rw-r--r-- | esp8266/modules/apa102.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/esp8266/modules/apa102.py b/esp8266/modules/apa102.py new file mode 100644 index 0000000000..41b7c0485c --- /dev/null +++ b/esp8266/modules/apa102.py @@ -0,0 +1,17 @@ +# APA102 driver for MicroPython on ESP8266 +# MIT license; Copyright (c) 2016 Robert Foss, Daniel Busch + +from esp import apa102_write +from neopixel import NeoPixel + + +class APA102(NeoPixel): + ORDER = (0, 1, 2, 3) + + def __init__(self, clock_pin, data_pin, n, bpp=4): + super().__init__(data_pin, n, bpp) + self.clock_pin = clock_pin + self.clock_pin.init(clock_pin.OUT) + + def write(self): + apa102_write(self.clock_pin, self.pin, self.buf) |