CONFIG RAINBOW
Contents |
Action
This configuration command sets up the number of rainbow channels and their ports & pins.
Syntax
CONFIG RAINBOW=channels, RBx_LEN=leds, RBx_PORT=port, RBx_PIN=pin
Remarks
Channels |
The number of channels. This is a numeric value in the range from 1-8. |
RBx_LEN |
The number of LED's for the channel. The minimum number of leds is 1. Each LED is made of 3 colors : R(ed), G(reen), and B(lue). A byte array named RAINBOW0_ will be created with a size of len * 3. Thus RB0_LEN=8 will create an array of RAINBOW0_(24). |
RBx_PORT |
The name of the PORT which is connected to the DI of the rainbow led(stripe). This is a port like PORTB. |
RBx_PIN |
The pin number of the port pin which is connected to the DI of the rainbow led(stripe). This is a number between 0-7. |
- The x should be replaced by a numeric value from 0-7.
Rainbow leds come in different forms and shapes. There are single LED, stripes with 8 leds, round circles with 24 leds, etc. All have a built in WS2812 RGB controller. The nice thing is that you can cascade leds by connecting the DO (output) to another DI (input). These stripes only requires 5V, GND and DI. You can connect different stripes to different port pins.
The original rainbow library is written by Galahat from the German bascom-forum. It is an excellent example on how to write your own libraries.
The MCS version is for the BASCOM integrated statements and functions. It is named rainbowBSC.lib. The lib uses a few routines from mcs.lib
A minimum CPU-speed of 8 MHz is required. Tests with WS1812b- types showed, it also works with frequencies down to 6.5 MHz because of the tolerance bandwidth by the chips.
See also
RB_ADDCOLOR, RB_ANDCOLOR, RB_ORCOLOR, RB_SUBCOLOR, RB_CLEARSTRIPE , RB_CLEARCOLORS , RB_FILL , RB_FILLCOLORS , RB_FILLSTRIPE , RB_SELECTCHANNEL, RB_SEND, RB_SETCOLOR , RB_SWAPCOLOR , RB_ROTATELEFT, RB_ROTATERIGHT, RB_SHIFTLEFT, RB_SHIFTRIGHT , RB_CHANGEPIN , RB_SETTABLECOLOR , RB_GETCOLOR , RB_LOOKUPCOLOR