ws2812b_sw
Library to support a chain of WS2812B chips by bit-banging
|
Author
|
Rob Hamerling, Copyright © 2014..2014, all rights reserved.
|
|
Adapted-by
|
|
|
Compiler
|
2.4q2
|
Description
Library to control a chain of WS2812Bs
This library uses 'bit banging' to transfer data to the WS2812Bs.
- A PIC with Fosc of at least 32 MHz is required.
- The user program must specify an alias for the control pin, like:
alias pin_WS2812B is pin_A1 -- pin_A1 used for WS2812B control
and the chosen pin must be configured for digital output.
- The number of WS2812Bs in the chain must be specified, like:
const byte WS2812B_NUM = 30 -- for 30 chained WS2812Bs
- The user program should contain 3 byte arrays of WS2812B_NUM bytes each, e.g.:
var byte agreen[WS2812B_NUM]
var byte ared[WS2812B_NUM]
var byte ablue[WS2812B_NUM]
and call the procedure ws2812b_refresh() to pass the current color settings
in these arrays to the WS2812B LEDs.
- Procedure ws2812b_all_color() can be used to set all LEDs to the same color
while keeping the color settings in the array unchanged.
Dependencies
Private
Private
Here are the list of samples which use this library: