RB_COLOR

RB_COLOR new 2080

Top  Previous  Next

Action

Color multiple LED's according to the bit pattern of a mask.

 

 

Syntax

RB_COLOR LED_start , Mask, Color1 [,Color2]

 

 

Remarks

LED_start

The index of the LED number. First LED is 0.

Mask

Bitmask of 8 LED’s. A set bit(1) will color a LED with COLOR1, according to its bit position + LED_start. A  zero-bit  turns a LED off, or optionally colors an LED with COLOR2. 

Color1

A byte array with a minimum length of 3 that holds the RGB information. A LONG or DWORD can be used as well.

Color2

This is an optional parameter.

A byte array with a minimum length of 3 that holds the RGB information. A LONG or DWORD can be used as well.

 

 

 

 

See also

CONFIG RAINBOW , 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_LOOKUPCOLOR RB_COPY

 

 

Example

 

'======================================
'RB_COLOR test
'======================================
$Regfile = "m32adef.dat"
$Crystal = 16000000
$hwstack = 40
$swstack = 32
$framesize = 32
Config Rainbow = 2 , Rb0_len = 8 , Rb0_port = Porta , Rb0_pin = 0 , Rb1_len = 8 , Rb1_port = Porta , Rb1_pin = 1
Dim Color1 as Dword
Dim Color2 as Dword
Const Red = &H000010
Const Blue = &H100000
 
Color1 = Red
Color2 = Blue
Rb_selectchannel 0
Do
  Rb_color 0 , &H88 , Color1
  Rb_send
  Wait 1
  Rb_color 0 , &H88 , Color2 , Color1
  Rb_send
  Wait 1
Loop
End