fix ws2812 doc
This commit is contained in:
parent
b7fa8c592f
commit
1ab8f526b0
|
@ -36,6 +36,9 @@ static int ws2812_write( lua_State* L )
|
|||
int top = lua_gettop( L );
|
||||
|
||||
for (int stack = 1; stack <= top; stack++) {
|
||||
if (lua_type( L, stack ) == LUA_TNIL)
|
||||
continue;
|
||||
|
||||
if (lua_type( L, stack ) != LUA_TTABLE) {
|
||||
ws2812_cleanup( L, 0 );
|
||||
luaL_checktype( L, stack, LUA_TTABLE ); // trigger error
|
||||
|
|
|
@ -7,15 +7,13 @@ ws2812 is a library to handle ws2812-like led strips.
|
|||
It works at least on WS2812, WS2812b, APA104, SK6812 (RGB or RGBW).
|
||||
|
||||
## ws2812.write()
|
||||
Send data to one or two led strip using its native format which is generally Green,Red,Blue for RGB strips
|
||||
and Green,Red,Blue,White for RGBW strips.
|
||||
Send data to up to 8 led strip using its native format which is generally Green,Red,Blue for RGB strips and Green,Red,Blue,White for RGBW strips.
|
||||
|
||||
#### Syntax
|
||||
`ws2812.write(array)`
|
||||
`ws2812.write(table, ...)`
|
||||
|
||||
#### Parameters
|
||||
Array containing an element for each chain (maximum of 8 elements):
|
||||
|
||||
Variable number of tables, each describing a single strip. Required elements are:
|
||||
- `pin` 0 ~ 33, I/O index
|
||||
- `data` payload to be sent to one or more WS2812 like leds through GPIO2
|
||||
|
||||
|
|
Loading…
Reference in New Issue