https://github.com/kizzycode/ws2812b-rust-rp2040
A driver implementation for up to 4 WS2812B LED strips
https://github.com/kizzycode/ws2812b-rust-rp2040
Last synced: 5 months ago
JSON representation
A driver implementation for up to 4 WS2812B LED strips
- Host: GitHub
- URL: https://github.com/kizzycode/ws2812b-rust-rp2040
- Owner: KizzyCode
- Created: 2022-07-18T19:24:45.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-12T18:07:26.000Z (almost 3 years ago)
- Last Synced: 2023-04-09T19:13:17.556Z (about 2 years ago)
- Language: C
- Size: 1.42 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE BSD 2-CLAUSE.md
Awesome Lists containing this project
README
[](https://opensource.org/licenses/BSD-2-Clause)
[](https://opensource.org/licenses/MIT)# WS2812B
A driver implementation for up to 4 WS2812B LED strips. The heavy I/O-lifting is done via the PIO co-processors to
ensure timing correctness.## Sending commands
The Pico accepts control transactions via USB or UART serial at 115200 baud/s.A transaction consists of
- a numeric command ID (recommended to be unique)
- zero or more commands
- a newlineA command constists of
- the LED strip index (0..4), followed by a colon
- the LED index (0..WS2812B_LED_MAX), followed by a colon
- the RGB-red value (0..256), followed by a colon
- the RGB-green value (0..256), followed by a colon
- the RGB-blue value (0..256), followed by a colonEach transaction is followed by a response. On success, the Pico returns `OK` followed by the command ID; on error, the
Pico returns `ERR` followed by the error message.### Syntax example
` :::: :::: <...>\n`### Specific example
- Request: `24454 0:0:255:0:0 0:1:0:255:0 0:2:0:0:255\n` - this sets the first LED to max red, the second LED
to max green and the third LED to max blue.
- Response: `OK 24454`## Build hints
The C-Pico-SDK must be linked into `$PROJECT_DIR/sdk`. Furthermore, this project requires a Rust-nightly toolchain for
`thumbv6m-none-eabi`.