RB COLOR

From MCS Wiki AVR
Revision as of 21:02, 17 January 2017 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

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

Languages   English  
Personal tools
Namespaces
Variants
Actions
Navigation
Language