RB ROTATELEFT

From MCS Wiki AVR
Revision as of 21:53, 15 June 2015 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Action

Rotate all LED's of the active channel to the left

 

 

Syntax

RB_ROTATELEFT Index , Width

 

 

Remarks

Index

A numeric variable or constant that specifies at which position the rotation should start. The first LED has index value 0.

Width

The number of LED's that ROTATE, starting at Index. Width should at least be 1.

 

This statement will rotate the memory to the left by one position. Width specifies how many LED's , index inclusive, will take part in the rotation.

Imagine 4 chairs with people on it. When they all stand up and go one place to the left, the person most left will have no chair to sit on. He will take the free chair on the right.

 

There is also a similar operation named SHIFT. When you SHIFT, information is lost : the person that has no chair on his left will leave the room and there will be 1 empty chair.

 

Since you can specify both the index and the width, rotation is very flexible : you can rotate all leds, or just a part of them.

 

The table below demonstrates a number of operation on a LED stipe of 4 LED's.

 

LED0

LED1

LED2

LED3

OPERATION/RESULT

 



led_green

OPERATION :  RB_ROTATELEFT 0,4

 


led_green


RESULT
 

led_green

led_green



OPERATION : RB_ROTATELEFT 0,2

led_green

led_green



RESULT

led_green




OPERATION : RB_ROTATELEFT 0,4



 

led_green

RESULT



led_green


OPERATION : RB_ROTATELEFT 1,2


led_green



RESULT

 

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

See RB_CHANGEPIN


Languages   English  
Personal tools
Namespaces
Variants
Actions
Navigation
Language