From 36522d59a5997fddbdaa9fe6eca5baecb2cc80df Mon Sep 17 00:00:00 2001 From: devsaurus Date: Mon, 11 Jan 2016 22:37:08 +0100 Subject: [PATCH] transferred ws2801 module documentation --- docs/en/modules/ws2801.md | 37 +++++++++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 38 insertions(+) create mode 100644 docs/en/modules/ws2801.md diff --git a/docs/en/modules/ws2801.md b/docs/en/modules/ws2801.md new file mode 100644 index 00000000..ae4c038f --- /dev/null +++ b/docs/en/modules/ws2801.md @@ -0,0 +1,37 @@ +# 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)) +``` diff --git a/mkdocs.yml b/mkdocs.yml index d1df6a52..77cdff69 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -51,6 +51,7 @@ pages: - 'u8g': 'en/modules/u8g.md' - 'uart': 'en/modules/uart.md' - 'ucg': 'en/modules/ucg.md' + - 'ws2801': 'en/modules/ws2801' - 'ws2812': 'en/modules/ws2812' - Deutsch: - Home: 'de/index.md'