diff --git a/docs/en/modules/apa102.md b/docs/en/modules/apa102.md index 00ccbd9e..653637b3 100644 --- a/docs/en/modules/apa102.md +++ b/docs/en/modules/apa102.md @@ -1,4 +1,9 @@ # APA102 Module +This module provides Lua access to [APA102 RGB LEDs](https://youtu.be/UYvC-hukz-0) which are similar in function to the common [WS2812](ws2812) addressable LEDs. + +> DotStar LEDs are 5050-sized LEDs with an embedded micro controller inside the LED. You can set the color/brightness of each LED to 24-bit color (8 bits each red green and blue). Each LED acts like a shift register, reading incoming color data on the input pins, and then shifting the previous color data out on the output pin. By sending a long string of data, you can control an infinite number of LEDs, just tack on more or cut off unwanted LEDs at the end. + +source: [Adafruit](https://www.adafruit.com/products/2343) ## apa102.write() Send ABGR data in 8 bits to a APA102 chain. @@ -16,16 +21,17 @@ Send ABGR data in 8 bits to a APA102 chain. - `G1` the first pixel's Green channel (0-255) - `R1` the first pixel's Red channel (0-255) ... You can connect a lot of APA102 ... - - `A1`, `G2`, `R2`, `B2` are the next APA102s Intensity, Blue, Green and channel parameters + - `A2`, `G2`, `R2`, `B2` are the next APA102s Intensity, Blue, Green and channel parameters #### Returns `nil` +#### Example ```lua a = 31 g = 0 r = 255 b = 0 -leds_bgr = string.char(a, g, r, b, a, g, r, b) +led_abgr = string.char(a, g, r, b, a, g, r, b) apa102.write(2, 3, leds_abgr) -- turn two APA102s to red, connected to data_pin 2 and clock_pin 3 ``` diff --git a/mkdocs.yml b/mkdocs.yml index 47837220..cd03b7eb 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -31,6 +31,7 @@ pages: - Support: 'en/support.md' - Modules: - 'adc': 'en/modules/adc.md' + - 'apa102': 'en/modules/apa102.md' - 'bit': 'en/modules/bit.md' - 'bmp085': 'en/modules/bmp085.md' - 'cjson': 'en/modules/cjson.md'