Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
c5d83590
Commit
c5d83590
authored
Feb 05, 2015
by
Till Klocke
Browse files
Updated README.md with instructions for the ws2812 module
parent
284ee8c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
c5d83590
...
...
@@ -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
))
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment