Commit c5d83590 authored by Till Klocke's avatar Till Klocke
Browse files

Updated README.md with instructions for the ws2812 module

parent 284ee8c4
......@@ -125,6 +125,7 @@ pre_build/latest/nodemcu_512k_latest.bin is removed. use pre_build/latest/nodemc
#define LUA_USE_MODULES_UART
#define LUA_USE_MODULES_OW
#define LUA_USE_MODULES_BIT
#define LUA_USE_MODULES_WS2812
#endif /* LUA_USE_MODULES */
...
// LUA_NUMBER_INTEGRAL
......@@ -329,3 +330,13 @@ cu:send("hello")
ds18b20 = nil
package.loaded["ds18b20"]=nil
```
####Control a WS2812 based light strip
```lua
-- set the color of one LED on GPIO 2 to red
ws2812.write(4, string.char(0, 255, 0))
-- set the color of 10 LEDs on GPIO 0 to blue
ws2812.write(3, string.char(0, 0, 255):rep(10))
-- first LED green, second LED white
ws2812.write(4, string.char(255, 0, 0, 255, 255, 255))
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment