CONFIG RAINBOW

(Difference between revisions)
Jump to: navigation, search
(Created page with "= <span class="f_Header">Action</span> = This configuration command sets up the number of rainbow channels and their ports & pins. <span style="font-family: Arial;"> </...")
 
Line 13: Line 13:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span style="font-family: Arial;">&nbsp;</span> =
+
= <span style="font-size: 14pt;">Remarks</span> =
 
+
= <span class="f_Header">Remarks</span> =
+
 
<div style="font-size: 13.3333330154419px; padding: 0px; margin: 0px 0px 0px 4px;">
 
<div style="font-size: 13.3333330154419px; padding: 0px; margin: 0px 0px 0px 4px;">
 
{| width="80%" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
{| width="80%" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
Line 30: Line 28:
  
 
| valign="top" width="108%" style="width: 599px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="108%" style="width: 599px; border: 1px solid rgb(0, 0, 0);" |  
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).
+
The number of LED's for the channel. The minimum number of leds is 1. Each LED is made of 3 colors&nbsp;: 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).
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 48: Line 46:
 
|}
 
|}
 
</div>
 
</div>
* The&nbsp;<span style="font-weight: bold;">x</span>&nbsp;should be replaced by a numeric value from 0-7.
+
*The&nbsp;<span style="font-weight: bold;">x</span>&nbsp;should be replaced by a numeric value from 0-7.
  
 
&nbsp;
 
&nbsp;
Line 74: Line 72:
 
= <span class="f_Header">See also</span> =
 
= <span class="f_Header">See also</span> =
  
<span style="font-family: Arial;">[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_addcolor.htm|RB_ADDCOLOR]],&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_andcolor.htm|RB_ANDCOLOR]],&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_orcolor.htm|RB_ORCOLOR]],&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_subcolor.htm|RB_SUBCOLOR]],&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_clearstripe.htm|RB_CLEARSTRIPE]]&nbsp;,&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_clearcolors.htm|RB_CLEARCOLORS]]&nbsp;,&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_fill.htm|RB_FILL]]&nbsp;,&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_fillcolors.htm|RB_FILLCOLORS]]&nbsp;,&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_fillstripe.htm|RB_FILLSTRIPE]]&nbsp;,[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_selectchannel.htm|RB_SELECTCHANNEL]],&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_send.htm|RB_SEND]],&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_setcolor.htm|RB_SETCOLOR]]&nbsp;,&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_swapcolor.htm|RB_SWAPCOLOR]]&nbsp;,&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_rotateleft.htm|RB_ROTATELEFT]],&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_rotateright.htm|RB_ROTATERIGHT]],&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_shiftleft.htm|RB_SHIFTLEFT]],&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_shiftright.htm|RB_SHIFTRIGHT]]&nbsp;,&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_changepin.htm|RB_CHANGEPIN]]&nbsp;,[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_settablecolor.htm|RB_SETTABLECOLOR]]&nbsp;,&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_getcolor.htm|RB_GETCOLOR]]&nbsp;,&nbsp;[[File:file:///D:/TRANSFER/AVRHELPHTML/15062015/HTML/rb_lookupcolor.htm|RB_LOOKUPCOLOR]]</span>
+
<span style="font-size: 10pt;">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</span><span style="font-family: Arial; font-size: 10pt;">&nbsp;</span>
  
<span style="font-family: Arial;">&nbsp;</span>
+
= <span style="font-size: 14pt; font-weight: bold;">Example</span> =
  
<span style="font-family: Arial;">&nbsp;</span>
+
[[Category:Pages with broken file links]]
 
+
<span style="font-family: Arial;">&nbsp;</span>
+
 
+
= <span style="font-size: 14pt; font-weight: bold;">Example</span> =
+

Revision as of 21:40, 15 June 2015

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

 

noticeA 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 

Example

Personal tools
Namespaces
Variants
Actions
Navigation
Language