Fix apa102 docs (#1470)

apa102.write expects a string with channel parameters in the ABGR order.
This commit is contained in:
Antoine 2016-08-25 09:28:37 +02:00 committed by Arnim Läuger
parent 5e01b51123
commit 369a107041
1 changed files with 4 additions and 4 deletions

View File

@ -19,13 +19,13 @@ Send ABGR data in 8 bits to a APA102 chain.
- `data_pin` any GPIO pin 0, 1, 2, ... - `data_pin` any GPIO pin 0, 1, 2, ...
- `clock_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. - `string` payload to be sent to one or more APA102 LEDs.
It should be composed from a AGRB quadruplet per element. It should be composed from a ABGR quadruplet per element.
- `A1` the first pixel's Intensity channel (0-31) - `A1` the first pixel's Intensity channel (0-31)
- `B1` the first pixel's Blue channel (0-255)<br /> - `B1` the first pixel's Blue channel (0-255)<br />
- `G1` the first pixel's Green channel (0-255) - `G1` the first pixel's Green channel (0-255)
- `R1` the first pixel's Red channel (0-255) - `R1` the first pixel's Red channel (0-255)
... You can connect a lot of APA102 ... ... 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 #### Returns
`nil` `nil`
@ -33,9 +33,9 @@ Send ABGR data in 8 bits to a APA102 chain.
#### Example #### Example
```lua ```lua
a = 31 a = 31
b = 0
g = 0 g = 0
r = 255 r = 255
b = 0 led_abgr = string.char(a, b, g, r, a, b, g, r)
led_abgr = string.char(a, g, r, b, a, g, r, b)
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
``` ```