From a0a08b4be1583aa7a4ef33d3b1b0aa6553732eca Mon Sep 17 00:00:00 2001 From: misterdanb Date: Mon, 28 Mar 2016 01:58:14 +0200 Subject: esp8266: Add APA102 serial individually controllable LEDs support. APA102 is a new "smart LED", similar to WS2812 aka "Neopixel". --- docs/esp8266/quickref.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs/esp8266') diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst index d2d677dc79..7b246a65e1 100644 --- a/docs/esp8266/quickref.rst +++ b/docs/esp8266/quickref.rst @@ -271,6 +271,26 @@ For low-level driving of a NeoPixel:: import esp esp.neopixel_write(pin, grb_buf, is800khz) +APA102 driver +------------- + +Use the ``apa102`` module:: + + from machine import Pin + from apa102 import APA102 + + clock = Pin(14, Pin.OUT) # set GPIO14 to output to drive the clock + data = Pin(13, Pin.OUT) # set GPIO13 to output to drive the data + apa = APA102(clock, data, 8) # create APA102 driver on the clock and the data pin for 8 pixels + apa[0] = (255, 255, 255, 31) # set the first pixel to white with a maximum brightness of 31 + apa.write() # write data to all pixels + r, g, b, brightness = apa[0] # get first pixel colour + +For low-level driving of an APA102:: + + import esp + esp.apa102_write(clock_pin, data_pin, rgbi_buf) + WebREPL (web browser interactive prompt) ---------------------------------------- -- cgit v1.2.3