RB COPY

From MCS Wiki AVR
(Difference between revisions)
Jump to: navigation, search
(Created page with "= <span class="f_Header">Action</span> = Copy whole stripes or any parts of it, to another stripes memory space at any position. <span style="font-family: Arial;"> </sp...")
 
 
Line 67: Line 67:
 
= <span class="f_Header">See also</span> =
 
= <span class="f_Header">See also</span> =
  
 
+
[[CONFIG RAINBOW|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]]
 
+
 
+
  
 
= <span style="font-size: 14pt; font-weight: bold;">Example</span> =
 
= <span style="font-size: 14pt; font-weight: bold;">Example</span> =

Latest revision as of 21:07, 17 January 2017

Contents

Action

Copy whole stripes or any parts of it, to another stripes memory space at any position.

 

 

Syntax

RB_COPY Source , SourceStart, Target, TargetStart, Count

 

 

Remarks

Source

The index of the source stripe.

SourceStart

The position to start the copy from

Target

The index of the target stripe. This can be the same stripe or another one.

TargetStart

The position to start the copy to.

Count

The number of bytes to copy.

 

 

This routine offers a faster track to copy a whole bunch of color data , if necessary.

 

 

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

Example

$regfile = "m32adef.dat"
$crystal = 16000000
$hwstack = 40
$swstack = 16
$framesize = 32
 
'(
RB_Copy Rainbow0_ , 5 ,Rainbow1_ ,0 , 3
' ^---- count of leds to copy
' ^---------- Led, start index of target
' ^------------------ target stripe or array
' ^------------------------ LED, start index of source
' ^-------------------------------- source stripe or array
')
 
Config Rainbow = 2 , Rb0_len = 8 , Rb0_port = Porta , Rb0_pin = 0 , _
 Rb1_len = 8 , Rb1_port = Porta , Rb1_pin = 1
 
Dim Color as Dword
 
Const Red = &H000010
Const Green = &H001000
Const Blue = &H100000
Const Yellow = &H001010
 
'color the first 4 LED
Rb_selectchannel 0
Color = Green
Rb_setcolor 0 , Color
 
Color = Red
RB_SetColor 1 , Color
 
Color = Blue
RB_SetColor 2 , Color
 
Color = Yellow
RB_SetColor 3 , Color
RB_Send
wait 1
' copy LED 0 to 3 of stripe 0 to pos 4 to 7
Rb_copy Rainbow0_ , 0 , Rainbow0_ , 4 , 4
Rb_send
Wait 1
 
' copy whole stripe0 to stripe1
RB_Copy Rainbow0_ , 0 , Rainbow1_ , 0 , 8
RB_Clearcolors
RB_SelectChannel(0) : RB_Send
RB_SelectChannel(1) : RB_Send
Wait 1
'copy LED1 of stripe1 to LED7 of stripe0
RB_Copy Rainbow1_ , 1 , Rainbow0_ , 7 , 1
RB_SelectChannel(0) : RB_Send
End

Languages   English  
Personal tools
Namespaces
Variants
Actions
Navigation
Language