<root>
<document scada='0' schema='103' license='1,60868906,8VT10V' title='' description='' fcversion='655616' target='RPI.RPI.RPI3B' >
	<config data='' clkspd='76800000' simspd='1' usewdt='0' constif='0' SSH_IP='01652BBCDF86326BADA2A8CAA77B969F' SSH_User='8D70AE113A18A8E2' SSH_Pass='FCF7C18E589E5238' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='.Index' />
		<watch expr='.Handle' />
		<watch expr='RGB[.Index][1]' />
	</debug>
	<traces />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='6' />
			<data name='ClockPin' value='26' />
			<data name='DataPort' value='6' />
			<data name='DataPin' value='16' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='14' />
			<data name='CalculatedCommsDelay' value='14' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='0' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='0161e243-0ca0-497d-88be-76351cf4dfa1' vstate='40' vmin='0' vmaj='2' srcleaf='LED_APA102C.fcfx' visiblename='RGB LED APA102C' description='A simple chained RGB LED controller IC allowing multiple LEDs to be controlled using a serial data stream.
Allows RGB LEDs to be driven with full 24-bit colour depth.
Allows single chains, 2D arrays and 3D cube formations to be simulated.
Supports Bit Banged or SPI peripheral based data modes.' category='LEDs' category2='' category3='' bIs2dOnly='0' bIs3dOnly='1' catenable='1' author='Matrix TSL' manuname='' manucode='' sysinfo='1053451' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' showmacros='1' iconpath='..\..\Icons\Components\LED Array 2.png' />
		<component class_type='root' codename='LED_APA102C' panelId='-1' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' comp2dType='0' >
			<resources />
			<properties >
				<property name='LED Properties' folder='property_2' hidden='0' >
					<property name='LED Arrangement' target='LED_Arrangement' typeid='16' hidden='0' locked='0' info='Controls the arrangement of the LEDs on the panel.

1D - Creates a straight line of LEDs
2D - Creates an X by Y Array of LEDs
3D - Creates an X by Y by Z Array of LEDs' filter='0001D
0012D
0023D' />
					<property name='LED Count' target='LED_Count' typeid='21' hidden='0' locked='0' info='Total number of LEDs in the design' />
					<property name='LED Columns' target='LED_Cols' typeid='21' hidden='1' locked='0' info='Number of horizontal LEDs - X axis' />
					<property name='Column Spacing' target='x_spacing' typeid='15' hidden='0' locked='0' info='X Spacing Between LEDs on the Panel' />
					<property name='LED Rows' target='LED_Rows' typeid='21' hidden='1' locked='0' info='Number of vertical LEDs - Y axis' />
					<property name='Row Spacing' target='y_spacing' typeid='15' hidden='1' locked='0' info='Y Spacing Between LEDs on the Panel' />
					<property name='LED Layers' target='LED_Layers' typeid='21' hidden='1' locked='0' info='Number of LED layers - Z axis' />
					<property name='Layer Spacing' target='z_spacing' typeid='15' hidden='1' locked='0' info='Z Spacing Between LEDs on the Panel' />
					<property name='Flip X' target='FlipX' typeid='7' hidden='1' locked='0' info='Flips the X axis if the LEDs are wired from the right hand side of the display.' />
					<property name='Flip Y' target='FlipY' typeid='7' hidden='1' locked='0' info='Flips the Y axis if the LEDs are wired from the bottom side of the display.' />
					<property name='Flip Z' target='FlipZ' typeid='7' hidden='1' locked='0' info='Flips the Z axis if the LEDs are wired from the upper most side of the display.' />
					<property name='LED Current Usage' target='CurrentUsage' typeid='16' hidden='0' locked='0' info='' filter='0000/31 (0%)
0011/31
0022/31
0033/31
0044/31
0055/31
0066/31
0077/31
0088/31
0099/31
01010/31
01111/31
01212/31
01313/31
01414/31
01515/31
01616/31
01717/31
01818/31
01919/31
02020/31
02121/31
02222/31
02323/31
02424/31
02525/31
02626/31
02727/31
02828/31
02929/31
03030/31
03131/31 (100%)' />
				</property>
				<property name='Connections' folder='property_1' hidden='0' >
					<property name='Output Mode' target='Output_Mode' typeid='16' hidden='0' locked='0' info='Sets the output mode used to drive the data to the LEDs
Bit Banged Mode = Allows Any I/O Pin but may be slower
SPI Mode = Fixed SPI Peripheral Pins but may be faster - Note that the SPI MISO pin will not be available for general I/O
' filter='000Bit Banged
001SPI' />
					<property name='Connection Properties' folder='property_4' hidden='1' >
						<property name='Data Pin' target='MOSI' typeid='5' hidden='0' locked='0' info='LED Data Pin - Connected to the Data In pin of the first WS8201 IC.' />
						<property name='Clock Pin' target='CLK' typeid='5' hidden='0' locked='0' info='LED Clock Pin - Connected to the Clock In pin of the first WS8201 IC.' />
					</property>
					<property name='Connection Properties' folder='property_3' hidden='0' >
						<property name='Channel' target='cal_spi::CHANNEL' typeid='16' hidden='0' locked='0' info='SPI Channel selector' filter='000Software
001Channel 1
' />
						<property name='Prescale' target='cal_spi::PR_SCALE' typeid='16' hidden='0' locked='0' info='Prescale option selector' filter='004Fosc/4
016Fosc/16
064Fosc/64' />
						<property name='MOSI' target='cal_spi::MOSI' typeid='5' hidden='0' locked='0' info='SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.' />
						<property name='MOSI Remap Pin' target='cal_spi::MOSIPins' typeid='16' hidden='1' locked='0' info='Select which the target pin to assign the MOSI hardware pin functionality.' filter='000$PORTC.0
001$PORTC.1
002$PORTC.2
003$PORTC.3
004$PORTC.4
005$PORTC.5
006$PORTC.6
007$PORTC.7
008$PORTB.0
009$PORTB.1
010$PORTB.2
011$PORTB.3
012$PORTB.4
013$PORTB.5
014$PORTB.6
015$PORTB.7' />
						<property name='MISO' target='cal_spi::MISO' typeid='5' hidden='0' locked='0' info='SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.' />
						<property name='MISO Remap Pin' target='cal_spi::MISOPins' typeid='16' hidden='1' locked='0' info='Select which the target pin to assign the MISO hardware pin functionality.' filter='016$PORTC.0
017$PORTC.1
018$PORTC.2
019$PORTC.3
020$PORTC.4
021$PORTC.5
022$PORTC.6
023$PORTC.7
008$PORTB.0
009$PORTB.1
010$PORTB.2
011$PORTB.3
012$PORTB.4
013$PORTB.5
014$PORTB.6
015$PORTB.7' />
						<property name='CLK' target='cal_spi::CLK' typeid='5' hidden='0' locked='0' info='SPI Clock Pin CLK - The Clock signal is driven by the SPI master.' />
						<property name='CLK Remap Pin' target='cal_spi::CLKPins' typeid='16' hidden='1' locked='0' info='Select which the target pin to assign the CLK hardware pin functionality.' filter='000$PORTC.0
001$PORTC.1
002$PORTC.2
003$PORTC.3
004$PORTC.4
005$PORTC.5
006$PORTC.6
007$PORTC.7
008$PORTB.0
009$PORTB.1
010$PORTB.2
011$PORTB.3
012$PORTB.4
013$PORTB.5
014$PORTB.6
015$PORTB.7' />
						<property name='Simulation' folder='property_5' hidden='0' >
							<property name='Scope Traces' target='cal_spi::ScopeTraces' typeid='7' hidden='0' locked='0' info='Selects if the scope traces are automatically generated or not' />
							<property name='Console Data' target='cal_spi::ConsoleData' typeid='7' hidden='0' locked='0' info='Selects if the console data is automatically generated or not' />
							<property name='API' target='cal_spi::Injector' typeid='16' hidden='0' locked='0' info='' filter='000' />
							<property name='API CS Pin' target='cal_spi1::InjectorCS' typeid='21' hidden='1' locked='0' info='' />
						</property>
					</property>
				</property>
			</properties>
			<values >
				<value target='LED_Arrangement' data='000' />
				<value target='LED_Count' data='25' />
				<value target='LED_Cols' data='3' />
				<value target='x_spacing' data='10.000000' />
				<value target='LED_Rows' data='5' />
				<value target='y_spacing' data='10.000000' />
				<value target='LED_Layers' data='3' />
				<value target='z_spacing' data='10.000000' />
				<value target='FlipX' data='0' />
				<value target='FlipY' data='0' />
				<value target='FlipZ' data='0' />
				<value target='CurrentUsage' data='016' />
				<value target='Output_Mode' data='001' />
				<value target='MOSI' data='$PORTC.5' />
				<value target='CLK' data='$PORTC.3' />
				<value target='cal_spi::CHANNEL' data='000' />
				<value target='cal_spi::PR_SCALE' data='004' />
				<value target='cal_spi::MOSI' data='$PORTG.12' />
				<value target='cal_spi::MOSIPins' data='008' />
				<value target='cal_spi::MISO' data='$PORTG.9' />
				<value target='cal_spi::MISOPins' data='013' />
				<value target='cal_spi::CLK' data='$PORTG.25' />
				<value target='cal_spi::CLKPins' data='004' />
				<value target='cal_spi::ScopeTraces' data='1' />
				<value target='cal_spi::ConsoleData' data='1' />
				<value target='cal_spi::Injector' data='000' />
				<value target='cal_spi1::InjectorCS' data='' />
			</values>
			<events >
				<event class='Components' event='Initialise' target='Ev_Initialise' />
				<event class='Compile' event='AddVar' target='Ev_AddVar' />
				<event class='Components' event='Property' target='Ev_Property' />
			</events>
			<apis >
				<api name='SetBrightness' alt='SetBrightness' type='1' proto='1' />
				<api name='SetBrightnessByte' alt='SetBrightnessByte' type='1' proto='1' />
				<api name='SetAllLEDColour' alt='SetAllLEDColour' type='1' proto='1' />
				<api name='SetLEDColour' alt='SetLEDColour' type='1' proto='1' />
				<api name='Refresh' alt='RefreshSim' type='1' proto='1' />
				<api name='ShiftLEDs1D' alt='ShiftLEDs1D' type='1' proto='1' />
				<api name='Initialise' alt='Initialise' type='1' proto='1' />
			</apis>
			<variables >
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RGB' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' >
						<array size='32768' />
						<array size='3' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ColScale' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='255' setinit='255' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='SetBrightness' description='Allows the output colour brightness of the LEDs to be scaled down. For example to save current usage or to reduce brightness in dark environments. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Scaler' type='f32' description='Range: 0.0 to 1.0 Default: 1.0, 0 = Off, 0.5 = Half Brightness, 1.0 = Full Brightness' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.Scaler &gt; 1.0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Scaler = 1.0' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.Scaler &lt; 0.0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Scaler = 0.0' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.Scaler = .Scaler * 255.0' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='ColScale = .Scaler' />
							<exp exp='' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SetBrightnessByte' description='Allows the output colour brightness of the LEDs to be scaled down. For example to save current usage or to reduce brightness in dark environments. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Scaler' type='u8' description='Range: 0 to 255 Default: 255, 0 = Off, 128 = Half Brightness, 255 = Full Brightness' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='ColScale = .Scaler' />
							<exp exp='' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SetLEDColour' description='Sets the colour of a single LED in RAM as a 1D array.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='LED' type='u16' description='LED to change the colour / Range: 0 to (LED Count - 1)' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='R' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='G' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='B' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Check LED index is in range' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.LED &lt; LED_Count' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='ColScale &lt; 255' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
											<exp exp='RGB[.LED][0] = (.R * ColScale) &gt;&gt; 8' />
											<exp exp='RGB[.LED][1] = (.G * ColScale) &gt;&gt; 8' />
											<exp exp='RGB[.LED][2] = (.B * ColScale) &gt;&gt; 8' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Assign Colour to LED' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
											<exp exp='RGB[.LED][0] = .R' />
											<exp exp='RGB[.LED][1] = .G' />
											<exp exp='RGB[.LED][2] = .B' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SetAllLEDColour' description='Sets the colour of all the LEDs in RAM' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='R' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='G' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='B' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Index' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='ColScale &lt; 255' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.R = (.R * ColScale) &gt;&gt; 8' />
									<exp exp='.G = (.G * ColScale) &gt;&gt; 8' />
									<exp exp='.B = (.B * ColScale) &gt;&gt; 8' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='.Index &lt; LED_Count' >
							<flowline >
								<command class_type='calculation' title='Assign Colour to LED' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='RGB[.Index][0] = .R' />
									<exp exp='RGB[.Index][1] = .G' />
									<exp exp='RGB[.Index][2] = .B' />
								</command>
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Index = .Index + 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Refresh' description='Clocks out the current colour data to the LEDs from the values stored in RAM' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='Index' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='SubIndex' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Data' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='loop' title='Send 32 0-bits for Start Frame ' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='2' exp='4' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='Output_Mode = 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Output Most Significant Data Bit' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
											<exp exp='MOSI = 0' />
										</command>
										<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='2' exp='8' >
											<flowline >
												<command class_type='calculation' title='Toggle Clock' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
													<exp exp='CLK = 1' />
													<exp exp='CLK = 0' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='call' title='Call Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='cal_spi' macro='Master_Byte' >
											<argument exp='0' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='.Index &lt; LED_Count' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.SubIndex = 4' />
								</command>
								<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='.SubIndex &gt; 0' >
									<flowline >
										<command class_type='decision' title='current control byte?' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.SubIndex = 4' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
													<exp exp='.Data = 0xE0 | CurrentUsage' />
												</command>
											</flowline>
											<flowline >
												<command class_type='comment' title='' comment='Data order seems to be B G R' textarea='53,11,53,11' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' />
												<command class_type='calculation' title='Collect Single RGB LED Data byte' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
													<exp exp='.Data = RGB[.Index][.SubIndex - 1]' />
												</command>
											</flowline>
										</command>
										<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='Output_Mode = 0' swap='0' >
											<flowline >
												<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='2' exp='8' >
													<flowline >
														<command class_type='calculation' title='Output Most Significant Data Bit' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
															<exp exp='MOSI = .Data &amp; 0x80' />
														</command>
														<command class_type='calculation' title='Shift to next data bit' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
															<exp exp='.Data = .Data &lt;&lt; 1' />
														</command>
														<command class_type='calculation' title='Toggle Clock' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
															<exp exp='CLK = 1' />
															<exp exp='CLK = 0' />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='cal_spi' macro='Master_Byte' >
													<argument exp='.Data' />
												</command>
											</flowline>
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
											<exp exp='.SubIndex = .SubIndex - 1' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Index = .Index + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='loop' title='Send 32 1-bits for End Frame ' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='2' exp='4' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='Output_Mode = 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Output Most Significant Data Bit' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
											<exp exp='MOSI = 1' />
										</command>
										<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='2' exp='8' >
											<flowline >
												<command class_type='calculation' title='Toggle Clock' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
													<exp exp='CLK = 1' />
													<exp exp='CLK = 0' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='call' title='Call Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='cal_spi' macro='Master_Byte' >
											<argument exp='255' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ShiftLEDs1D' description='Shifts the LED colours in 1D and wraps ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Direction' type='u8' description='0 = Forwards, 1 = Backwards' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='DataMode' type='u8' description='0=ResetToZero, 1=WrapAroundDisplay, 2=Smear' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='R' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='G' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='B' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Index' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='RS' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='GS' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='BS' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Forwards or Backwards?' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.Direction = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Index = LED_Count - 1' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.DataMode = 1' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
											<exp exp='.RS = RGB[.Index][0]' />
											<exp exp='.GS = RGB[.Index][1]' />
											<exp exp='.BS = RGB[.Index][2]' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='.Index &gt; 0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
											<exp exp='RGB[.Index][0] = RGB[.Index - 1][0]' />
											<exp exp='RGB[.Index][1] = RGB[.Index - 1][1]' />
											<exp exp='RGB[.Index][2] = RGB[.Index - 1][2]' />
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
											<exp exp='.Index = .Index - 1' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Index = 0' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.DataMode = 1' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
											<exp exp='.RS = RGB[.Index][0]' />
											<exp exp='.GS = RGB[.Index][1]' />
											<exp exp='.BS = RGB[.Index][2]' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='.Index &lt; (LED_Count - 1)' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
											<exp exp='RGB[.Index][0] = RGB[.Index + 1][0]' />
											<exp exp='RGB[.Index][1] = RGB[.Index + 1][1]' />
											<exp exp='RGB[.Index][2] = RGB[.Index + 1][2]' />
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
											<exp exp='.Index = .Index + 1' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.DataMode' >
							<case >
								<flowline >
									<command class_type='comment' title='' comment='Reset
' textarea='12,0,12,0' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' />
									<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
										<exp exp='RGB[.Index][0] = 0' />
										<exp exp='RGB[.Index][1] = 0' />
										<exp exp='RGB[.Index][2] = 0' />
									</command>
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='comment' title='' comment='Wrap
' textarea='12,0,12,0' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' />
									<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
										<exp exp='RGB[.Index][0] = .RS' />
										<exp exp='RGB[.Index][1] = .GS' />
										<exp exp='RGB[.Index][2] = .BS' />
									</command>
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='comment' title='' comment='Smear' textarea='12,0,12,0' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' />
								</flowline>
							</case>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='RefreshSim' description='Clocks out the current colour data to the LEDs from the values stored in RAM' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='Index' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='Handle' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Dir' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='Offset' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='StartIdx' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Allow SPI data to be generated' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Refresh' />
						<command class_type='comment' title='' comment='Now service simulation objects' textarea='12,0,12,0' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' />
						<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='LED_Arrangement' >
							<case >
								<flowline >
									<command class_type='comment' title='' comment='1D' textarea='12,0,12,0' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' />
									<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='.Index &lt; LED_Count' >
										<flowline >
											<command class_type='sim' title='Simulation' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='clone_matrix1' macro='GetHandleFor' >
												<return exp='.Handle' />
												<argument exp='.Index' />
											</command>
											<command class_type='sim' title='Simulation' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Component.Property.SetColor' >
												<argument exp='.Handle' />
												<argument exp='RGB[.Index][0]' />
												<argument exp='RGB[.Index][1]' />
												<argument exp='RGB[.Index][2]' />
											</command>
											<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
												<exp exp='.Index = .Index + 1' />
											</command>
										</flowline>
									</command>
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='comment' title='' comment='2D' textarea='12,0,12,0' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' />
									<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='.Index &lt; LED_Count' >
										<flowline >
											<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.Dir = 1' swap='0' >
												<flowline >
													<command class_type='sim' title='Simulation' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='clone_matrix1' macro='GetHandleFor' >
														<return exp='.Handle' />
														<argument exp='.StartIdx + .Offset' />
													</command>
													<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
														<exp exp='.Offset = .Offset - 1' />
													</command>
												</flowline>
												<flowline >
													<command class_type='sim' title='Simulation' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='clone_matrix1' macro='GetHandleFor' >
														<return exp='.Handle' />
														<argument exp='.Index' />
													</command>
												</flowline>
											</command>
											<command class_type='sim' title='Simulation' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Component.Property.SetColor' >
												<argument exp='.Handle' />
												<argument exp='RGB[.Index][0]' />
												<argument exp='RGB[.Index][1]' />
												<argument exp='RGB[.Index][2]' />
											</command>
											<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
												<exp exp='.Index = .Index + 1' />
											</command>
											<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='(.Index % LED_Cols) == 0' swap='0' >
												<flowline >
													<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
														<exp exp='.Dir = (.Dir + 1) &amp; 1' />
													</command>
													<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
														<exp exp='.Offset = LED_Cols - 1' />
													</command>
													<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
														<exp exp='.StartIdx = .Index' />
													</command>
												</flowline>
												<flowline />
											</command>
										</flowline>
									</command>
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='comment' title='' comment='3D - Not right yet

When we move to the second layer we might have to count backwards for the entire layer' textarea='12,0,12,0' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' />
									<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='.Index &lt; LED_Count' >
										<flowline >
											<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.Dir = 1' swap='0' >
												<flowline >
													<command class_type='sim' title='Simulation' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='clone_matrix1' macro='GetHandleFor' >
														<return exp='.Handle' />
														<argument exp='.StartIdx + .Offset' />
													</command>
													<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
														<exp exp='.Offset = .Offset - 1' />
													</command>
												</flowline>
												<flowline >
													<command class_type='sim' title='Simulation' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='clone_matrix1' macro='GetHandleFor' >
														<return exp='.Handle' />
														<argument exp='.Index' />
													</command>
												</flowline>
											</command>
											<command class_type='sim' title='Simulation' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Component.Property.SetColor' >
												<argument exp='.Handle' />
												<argument exp='RGB[.Index][0]' />
												<argument exp='RGB[.Index][1]' />
												<argument exp='RGB[.Index][2]' />
											</command>
											<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
												<exp exp='.Index = .Index + 1' />
											</command>
											<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='(.Index % LED_Cols) == 0' swap='0' >
												<flowline >
													<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
														<exp exp='.Dir = (.Dir + 1) &amp; 1' />
													</command>
													<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
														<exp exp='.Offset = LED_Cols - 1' />
													</command>
													<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
														<exp exp='.StartIdx = .Index' />
													</command>
												</flowline>
												<flowline />
											</command>
										</flowline>
									</command>
								</flowline>
							</case>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Initialise' />
						<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='SetAllLEDColour' >
									<argument exp='255' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Call Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Refresh' />
								<command class_type='delay' title='Delay' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='1' type='2' />
								<command class_type='call' title='Call Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='SetAllLEDColour' >
									<argument exp='0' />
									<argument exp='255' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Call Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Refresh' />
								<command class_type='delay' title='Delay' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='1' type='2' />
								<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='SetAllLEDColour' >
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='255' />
								</command>
								<command class_type='call' title='Call Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Refresh' />
								<command class_type='delay' title='Delay' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='1' type='2' />
								<command class_type='call' title='Call Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='SetAllLEDColour' >
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Refresh' />
								<command class_type='delay' title='Delay' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='1' type='2' />
								<command class_type='call' title='Call Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='SetLEDColour' >
									<argument exp='4' />
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='255' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='ShiftLEDs1D' >
									<argument exp='1' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Refresh' />
								<command class_type='delay' title='Delay' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='1' type='2' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialise' description='Inisialises the RGB colour RAM to 0,0,0 = LED Off and clocks out the data to 
initialise all the WS2801 ICs in the chain.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='Output_Mode = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='MOSI = 0' />
									<exp exp='CLK = 0' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='cal_spi' macro='Master_Init' />
							</flowline>
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='SetAllLEDColour' >
							<argument exp='0' />
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Refresh' />
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='b295124a-85ec-4fae-943f-347bb2c50311' vmin='0' vmaj='1' codename='shape_sphere1' panelId='-1' x='0' y='0' z='0' xsz='0.15625' ysz='0.15625' zsz='0.15625' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='0' scadavisible='1' interactive='0' solid='0' layer='0' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='1975743' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9d67e3dc-ef9b-4d4d-b294-19c176eefab1' vmin='1' vmaj='1' codename='clone_matrix1' panelId='-1' x='0' y='0' z='0' xsz='0.2' ysz='0.2' zsz='0.2' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='target_object' data='shape_sphere1' />
					<value target='hide_target' data='1' />
					<value target='x_count' data='25' />
					<value target='x_spacing' data='10.000000' />
					<value target='OldX' data='25' />
					<value target='SpaX' data='10.000000' />
					<value target='y_count' data='1' />
					<value target='y_spacing' data='10.000000' />
					<value target='OldY' data='1' />
					<value target='SpaY' data='10.000000' />
					<value target='z_count' data='1' />
					<value target='z_spacing' data='10.000000' />
					<value target='OldZ' data='1' />
					<value target='SpaZ' data='10.000000' />
					<value target='target_visibility' data='1' />
					<value target='target_solidity' data='1' />
					<value target='target_interactive' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c67171df-0ad6-4b11-8361-cfe14b072847' vmin='1' vmaj='2' codename='cal_spi' panelId='-1' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='ENABLED' data='1' />
					<value target='REF' data='1' />
					<value target='CHANNEL' data='000' />
					<value target='MOSI' data='$PORTG.12' />
					<value target='MOSIPins' data='008' />
					<value target='MISO' data='$PORTG.9' />
					<value target='MISOPins' data='013' />
					<value target='CLK' data='$PORTG.25' />
					<value target='CLKPins' data='004' />
					<value target='UseAutoCS' data='0' />
					<value target='UseCS' data='0' />
					<value target='SS' data='' />
					<value target='CSPolarity' data='000' />
					<value target='SSPins' data='000' />
					<value target='AltSSPin' data='0' />
					<value target='Mode' data='000' />
					<value target='PR_SCALE' data='004' />
					<value target='CKE' data='001' />
					<value target='CKP' data='000' />
					<value target='SMP' data='000' />
					<value target='ScopeTraces' data='1' />
					<value target='ConsoleData' data='1' />
					<value target='Injector' data='000' />
					<value target='InjectorCS' data='0' />
					<value target='InjectorHandle' data='0' />
					<value target='InjectorChannel' data='0' />
					<value target='Loading' data='0' />
					<value target='BMODE' data='2' />
					<value target='MOSI_PORT' data='$PORTG.12' />
					<value target='MOSI_TRIS' data='$PORTG.12' />
					<value target='MOSI_PIN' data='12' />
					<value target='MISO_PORT' data='$PORTG.9' />
					<value target='MISO_TRIS' data='$PORTG.9' />
					<value target='MISO_PIN' data='9' />
					<value target='SCK_PORT' data='$PORTG.25' />
					<value target='SCK_TRIS' data='$PORTG.25' />
					<value target='SCK_PIN' data='25' />
					<value target='SS_PORT' data='' />
					<value target='SS_TRIS' data='' />
					<value target='SS_PIN' data='0' />
					<value target='Remappable' data='' />
					<value target='MOSIReg' data='008' />
					<value target='CLKREG' data='004' />
					<value target='MOSIRPNUM' data='21' />
					<value target='MOSIBank' data='b' />
					<value target='MOSIBank2' data='c' />
					<value target='CLKRPNUM' data='20' />
					<value target='CLKBank' data='b' />
					<value target='MISORPREG' data='SSP1DATPPS' />
					<value target='MISOBank' data='b' />
					<value target='SPIName' data='' />
					<value target='MISOReg' data='000' />
					<value target='SPIClock' data='' />
					<value target='MISOBank2' data='c' />
					<value target='CLKBank2' data='c' />
					<value target='ParentName' data='' />
					<value target='BitDelay' data='0' />
					<value target='ClockSpeed' data='76800000' />
					<value target='MasterDivider' data='8' />
					<value target='Sim' data='1' />
					<value target='CLKRPREG' data='' />
					<value target='SSRPREG' data='' />
					<value target='SSBank' data='' />
					<value target='SSBank2' data='' />
					<value target='AltSSReg' data='' />
					<value target='AltSSMask' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='5767167' img='' style='0' />
		<camera xe='11.0445' ye='5.67495' ze='1022.03' xt='11.0445' yt='5.67495' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='323' dy='528' zoom='38.2404' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='15793151' />
		<winpos ID='7005' RectRecentFloat='862,44,1680,826' RectRecentDocked='974,141,1317,759' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='28' />
		<camera xe='-50.6873' ye='-53.5552' ze='49.5864' xt='1.7419' yt='-1.12074' zt='-2.84789' xquat='-0.424706' yquat='0.1759' zquat='0.339844' wquat='0.820481' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
		<winpos ID='7004' RectRecentFloat='556,304,1206,754' RectRecentDocked='1062,141,1317,759' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='1' />
	</panel3d>
	<panels2d count='0' />
	<layout >
		<view type='0' name='SetAllLEDColour' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUgIAAGUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetBrightness' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUgIAAGUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetBrightnessByte' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUgIAAGUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetLEDColour' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUgIAAGUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Refresh' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUgIAAGUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='RefreshSim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUgIAAGUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUgIAAGUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ShiftLEDs1D' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUgIAAGUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUgIAAGUCAAA' zoom='65' scrollx='0' scrolly='257' flags='0' />
	</layout>
</document>
</root>
