This module has an _optional_ dependency to the [pixbuf module](pixbuf.md) i.e. it can work without. However, if you compile the firmware without pixbuf the respective features will be missing from this module.
## apa102.write()
Send ABGR data in 8 bits to a APA102 chain.
...
...
@@ -18,7 +22,7 @@ Send ABGR data in 8 bits to a APA102 chain.
#### Parameters
-`data_pin` any GPIO pin 0, 1, 2, ...
-`clock_pin` any GPIO pin 0, 1, 2, ...
-`string` payload to be sent to one or more APA102 LEDs.
-`data` payload to be sent to one or more APA102 LEDs.
It may be a [pixbuf](pixbuf) with four channels or a string,
The library uses any GPIO to bitstream the led control commands.
!!! caution
This module has an _optional_ dependency to the [pixbuf module](pixbuf.md) i.e. it can work without. However, if you compile the firmware without pixbuf the respective features will be missing from this module.
## tm1829.write()
Send data to a led strip using native chip format.
#### Syntax
`tm1829.write(string)`
`tm1829.write(data)`
#### Parameters
-`string` payload to be sent to one or more TM1829 leds. It is either
-`data` payload to be sent to one or more TM1829 leds. It is either
a 3-channel [pixbuf](pixbuf)(e.g.,`pixbuf.TYPE_RGB`) or a string of
This module has an _optional_ dependency to the [pixbuf module](pixbuf.md) i.e. it can work without. However, if you compile the firmware without pixbuf the respective features will be missing from this module.
## ws2801.init()
Initializes the module and sets the pin configuration.
...
...
@@ -18,19 +21,24 @@ Initializes the module and sets the pin configuration.
`nil`
## ws2801.write()
Sends a string of RGB Data in 24 bits to WS2801. Don't forget to call `ws2801.init()` before.
Sends data of RGB Data in 24 bits to WS2801. Don't forget to call `ws2801.init()` before.
#### Syntax
`ws2801.write(string)`
`ws2801.write(data)`
####Parameters
-`string` payload to be sent to one or more WS2801.
-`data` payload to be sent to one or more WS2801.
Payload type could be:
-`string` representing bytes to send
It should be composed from an RGB triplet per element.
-`R1` the first pixel's red channel value (0-255)
-`G1` the first pixel's green channel value (0-255)
-`B1` the first pixel's blue channel value (0-255)<br/>
... You can connect a lot of WS2801...
-`R2`, `G2`, `B2` are the next WS2801's Red, Green, and Blue channel values
- a [pixbuf](pixbuf) object containing the bytes to send. The pixbuf's type is not checked!
@@ -15,7 +15,7 @@ Note that dual mode is currently not supported for effects.
!!! caution
This module depends on the [color utils module](color-utils.md). Things **will** fail if that module is missing in the firmware!
This module depends on the [color utils module](color-utils.md) and [pixbuf module](pixbuf.md). Things **will** fail if those modules are missing in the firmware!
@@ -15,6 +15,10 @@ through the serial port (it will be reconfigured to support WS2812-like
protocol). If you want to keep access to Lua's console, you will have to
use an other input channel like a TCP server (see [example](https://github.com/nodemcu/nodemcu-firmware/blob/release/lua_modules/telnet/telnet.lua))
!!! caution
This module has an _optional_ dependency to the [pixbuf module](pixbuf.md) i.e. it can work without. However, if you compile the firmware without pixbuf the respective features will be missing from this module.
## ws2812.init()
Initialize UART1 and GPIO2, should be called once and before write().
Initialize UART0 (TXD0) too if `ws2812.MODE_DUAL` is set.
...
...
@@ -54,6 +58,7 @@ and the next invocation thereof.
-`data2` (optional) payload to be sent to one or more WS2812 like leds through TXD0 (`ws2812.MODE_DUAL` mode required)
Payload type could be:
-`nil` nothing is done
-`string` representing bytes to send
- a [pixbuf](pixbuf) object containing the bytes to send. The pixbuf's type is not checked!
...
...
@@ -90,7 +95,7 @@ For this purpose, the [pixbuf](pixbuf) library offers a read/write buffer and
convenient functions for pixel value manipulation.
For backwards-compatibility, `pixbuf.newBuffer()` is aliased as
`ws2812.newBuffer`, but this will be removed in the next nodemcu-firmware
`ws2812.newBuffer()`, but this will be removed in the next nodemcu-firmware