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
36522d59
Commit
36522d59
authored
Jan 11, 2016
by
devsaurus
Browse files
transferred ws2801 module documentation
parent
75580f5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
docs/en/modules/ws2801.md
0 → 100644
View file @
36522d59
# WS2801 Module
## ws2801.init()
Initializes the module and sets the pin configuration.
#### Syntax
`ws2801.init(pin_clk, pin_data)`
#### Parameters
-
`pin_clk`
pin for the clock. Supported are GPIO 0, 2, 4, 5.
-
`pin_data`
pin for the data. Supported are GPIO 0, 2, 4, 5.
#### Returns
`nil`
## ws2801.write()
Sends a string of RGB Data in 24 bits to WS2801. Don't forget to call
`ws2801.init()`
before.
#### Syntax
`ws2801.write(string)`
####Parameters
-
`string`
payload to be sent to one or more WS2801.
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)
... You can connect a lot of WS2801...
-
`R2`
,
`G2`
,
`B2`
are the next WS2801's Red, Green, and Blue channel values
#### Returns
`nil`
#### Example
```
lua
ws2801
.
write
(
string.char
(
255
,
0
,
0
,
0
,
255
,
0
,
0
,
0
,
255
))
```
mkdocs.yml
View file @
36522d59
...
@@ -51,6 +51,7 @@ pages:
...
@@ -51,6 +51,7 @@ pages:
-
'
u8g'
:
'
en/modules/u8g.md'
-
'
u8g'
:
'
en/modules/u8g.md'
-
'
uart'
:
'
en/modules/uart.md'
-
'
uart'
:
'
en/modules/uart.md'
-
'
ucg'
:
'
en/modules/ucg.md'
-
'
ucg'
:
'
en/modules/ucg.md'
-
'
ws2801'
:
'
en/modules/ws2801'
-
'
ws2812'
:
'
en/modules/ws2812'
-
'
ws2812'
:
'
en/modules/ws2812'
-
Deutsch
:
-
Deutsch
:
-
Home
:
'
de/index.md'
-
Home
:
'
de/index.md'
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