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
3f418f99
Commit
3f418f99
authored
Apr 11, 2016
by
Falk Kühnel
Committed by
Marcel Stör
Apr 11, 2016
Browse files
changed documentation for ws2812 module, which only works for pin GPIO2 at the moment (#1235)
parent
61c2b4df
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/en/modules/ws2812.md
View file @
3f418f99
...
@@ -11,7 +11,7 @@ Send GRB data in 8 bits to a WS2812 chain.
...
@@ -11,7 +11,7 @@ Send GRB data in 8 bits to a WS2812 chain.
`ws2812.writegrb(pin, string)`
`ws2812.writegrb(pin, string)`
#### Parameters
#### Parameters
-
`pin`
any GPIO pin 0, 1, 2, ..
.
-
`pin`
is ignored. Only works with GPIO2
.
-
`string`
payload to be sent to one or more WS2812 LEDs.
-
`string`
payload to be sent to one or more WS2812 LEDs.
It should be composed from a GRB triplet per element.
It should be composed from a GRB triplet per element.
-
`G1`
the first pixel's Green channel (0-255)
-
`G1`
the first pixel's Green channel (0-255)
...
@@ -28,7 +28,7 @@ g = 0
...
@@ -28,7 +28,7 @@ g = 0
r
=
255
r
=
255
b
=
0
b
=
0
leds_grb
=
string.char
(
g
,
r
,
b
,
g
,
r
,
b
)
leds_grb
=
string.char
(
g
,
r
,
b
,
g
,
r
,
b
)
ws2812
.
write
(
2
,
leds_grb
)
-- turn two WS2812Bs to red, connected to pin 2
ws2812
.
write
(
2
,
leds_grb
)
-- turn two WS2812Bs to red, connected to pin
GPIO
2
```
```
## ws2812.writergb()
## ws2812.writergb()
...
@@ -38,7 +38,7 @@ Send GRB data in 8bits to a WS2812 chain.
...
@@ -38,7 +38,7 @@ Send GRB data in 8bits to a WS2812 chain.
`ws2812.writergb(pin, string)`
`ws2812.writergb(pin, string)`
#### Parameters
#### Parameters
-
`pin`
any GPIO pin 0, 1, 2, ..
.
-
`pin`
is ignored. Only works with GPIO2
.
-
`string`
payload to be sent to one or more WS2812 LEDs.
-
`string`
payload to be sent to one or more WS2812 LEDs.
It should be composed from an RGB triplet per element.
It should be composed from an RGB triplet per element.
-
`R1`
the first pixel's Red channel (0-255)
-
`R1`
the first pixel's Red channel (0-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