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
57950413
Commit
57950413
authored
Dec 30, 2016
by
Tobias Tangemann
Committed by
Marcel Stör
Dec 30, 2016
Browse files
Fix and extend sample in apa102 module docu (#1689)
parent
007f870c
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/en/modules/apa102.md
View file @
57950413
...
@@ -30,12 +30,18 @@ Send ABGR data in 8 bits to a APA102 chain.
...
@@ -30,12 +30,18 @@ Send ABGR data in 8 bits to a APA102 chain.
#### Returns
#### Returns
`nil`
`nil`
#### Example
#### Example
1
```
lua
```
lua
a
=
31
a
=
31
b
=
0
b
=
0
g
=
0
g
=
0
r
=
255
r
=
255
led_abgr
=
string.char
(
a
,
b
,
g
,
r
,
a
,
b
,
g
,
r
)
led
s
_abgr
=
string.char
(
a
,
b
,
g
,
r
,
a
,
b
,
g
,
r
)
apa102
.
write
(
2
,
3
,
leds_abgr
)
-- turn two APA102s to red, connected to data_pin 2 and clock_pin 3
apa102
.
write
(
2
,
3
,
leds_abgr
)
-- turn two APA102s to red, connected to data_pin 2 and clock_pin 3
```
```
#### Example 2
```
lua
-- set the first 30 leds to red
apa102
.
write
(
2
,
3
,
string.char
(
31
,
255
,
0
,
0
):
rep
(
30
))
```
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