WS2801 Module¶
| Since | Origin / Contributor | Maintainer | Source |
|---|---|---|---|
| 2015-07-12 | Espressif example, Konrad Beckmann | Konrad Beckmann | ws2801.c |
ws2801.init()¶
Initializes the module and sets the pin configuration.
Syntax¶
ws2801.init(pin_clk, pin_data)
Parameters¶
pin_clkpin for the clock. Supported are GPIO 0, 2, 4, 5.pin_datapin for the data. Supported are GPIO 0, 2, 4, 5.
Returns¶
nil
ws2801.write()¶
Sends a string of RGB Data in 24 bits to WS2801. Don't forget to call ws2801.init() before.
Syntax¶
ws2801.write(string)
Parameters¶
stringpayload to be sent to one or more WS2801. It should be composed from an RGB triplet per element.R1the first pixel's red channel value (0-255)G1the first pixel's green channel value (0-255)B1the first pixel's blue channel value (0-255)
... You can connect a lot of WS2801...R2,G2,B2are the next WS2801's Red, Green, and Blue channel values
Returns¶
nil
Example¶
ws2801.write(string.char(255,0,0, 0,255,0, 0,0,255))