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
369a1070
Commit
369a1070
authored
Aug 25, 2016
by
Antoine
Committed by
Arnim Läuger
Aug 25, 2016
Browse files
Fix apa102 docs (#1470)
apa102.write expects a string with channel parameters in the ABGR order.
parent
5e01b511
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/en/modules/apa102.md
View file @
369a1070
...
...
@@ -19,13 +19,13 @@ Send ABGR data in 8 bits to a APA102 chain.
-
`data_pin`
any GPIO pin 0, 1, 2, ...
-
`clock_pin`
any GPIO pin 0, 1, 2, ...
-
`string`
payload to be sent to one or more APA102 LEDs.
It should be composed from a AGR
B
quadruplet per element.
It should be composed from a A
B
GR quadruplet per element.
-
`A1`
the first pixel's Intensity channel (0-31)
-
`B1`
the first pixel's Blue channel (0-255)
<br
/>
-
`G1`
the first pixel's Green channel (0-255)
-
`R1`
the first pixel's Red channel (0-255)
... You can connect a lot of APA102 ...
-
`A2`
,
`G2`
,
`R2`
,
`B2`
are the next APA102s Intensity, Blue, Green and channel parameters
-
`A2`
,
`B2`
,
`G2`
,
`R2`
are the next APA102s Intensity, Blue, Green and
Red
channel parameters
#### Returns
`nil`
...
...
@@ -33,9 +33,9 @@ Send ABGR data in 8 bits to a APA102 chain.
#### Example
```
lua
a
=
31
b
=
0
g
=
0
r
=
255
b
=
0
led_abgr
=
string.char
(
a
,
g
,
r
,
b
,
a
,
g
,
r
,
b
)
led_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
```
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