<root>
<document scada='0' schema='103' license='10,BenR,C9TN1M' 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 />
			<values />
			<events >
				<event class='Components' event='Property' target='Ev_Property' />
				<event class='Components' event='Initialise' target='Ev_Initialise' />
				<event class='Compile' event='AddVar' target='Ev_AddVar' />
			</events>
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='RGB' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='3' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Idx' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Dir' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='3' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RandomMask' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<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='Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='LED_APA102C1' macro='Initialise' />
						<command class_type='call' title='Call Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='LED_APA102C1' 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' component='LED_APA102C1' 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' component='LED_APA102C1' 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' component='LED_APA102C1' 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' component='LED_APA102C1' 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' component='LED_APA102C1' 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='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='RGB[0] = 0' />
							<exp exp='RGB[1] = 128' />
							<exp exp='RGB[2] = 255' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='Dir[0] = 0' />
							<exp exp='Dir[1] = 0' />
							<exp exp='Dir[2] = 1' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='0' cmdgradient='4' cmdopacity='0.64' type='0' exp='1' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='RandomMask = Random() &amp; 0x07' />
								</command>
								<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='0' cmdgradient='4' cmdopacity='0.64' type='2' forvar='Idx' exp='3' >
									<flowline >
										<command class_type='decision' title='Are we counting up?' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='0' cmdgradient='4' cmdopacity='0.64' exp='Dir[Idx] = 0' swap='0' >
											<flowline >
												<command class_type='decision' title='Max Value?' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='0' cmdgradient='4' cmdopacity='0.64' exp='RGB[Idx] = 255' swap='0' >
													<flowline >
														<command class_type='calculation' title='Switch to counting down' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
															<exp exp='DIR[Idx] = 1' />
														</command>
													</flowline>
													<flowline >
														<command class_type='decision' title='Randomise colour change' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='0' cmdgradient='4' cmdopacity='0.64' exp='RandomMask &amp; (1 &lt;&lt; Idx)' swap='0' >
															<flowline >
																<command class_type='calculation' title='Increment colour channel' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
																	<exp exp='RGB[Idx] = RGB[Idx] + 1' />
																</command>
															</flowline>
															<flowline />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline >
												<command class_type='decision' title='Min Value?' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='0' cmdgradient='4' cmdopacity='0.64' exp='RGB[Idx] = 0' swap='0' >
													<flowline >
														<command class_type='calculation' title='Switch to counting up' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
															<exp exp='DIR[Idx] = 0' />
														</command>
													</flowline>
													<flowline >
														<command class_type='decision' title='Randomise colour change' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='0' cmdgradient='4' cmdopacity='0.64' exp='RandomMask &amp; (1 &lt;&lt; Idx)' swap='0' >
															<flowline >
																<command class_type='calculation' title='Decrement colour channel' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
																	<exp exp='RGB[Idx] = RGB[Idx] - 1' />
																</command>
															</flowline>
															<flowline />
														</command>
													</flowline>
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Shift along LEDs' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='LED_APA102C1' macro='ShiftLEDs1D' >
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Assign new colour to first LED' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='LED_APA102C1' macro='SetLEDColour' >
									<argument exp='0' />
									<argument exp='RGB[0]' />
									<argument exp='RGB[1]' />
									<argument exp='RGB[2]' />
								</command>
								<command class_type='call' title='Call Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='LED_APA102C1' macro='Refresh' />
								<command class_type='delay' title='Delay' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='20' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='0161e243-0ca0-497d-88be-76351cf4dfa1' vmin='0' vmaj='2' codename='LED_APA102C1' panelId='-1' x='0' y='0' z='0' xsz='25' ysz='25' zsz='25' 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='LED_Arrangement' data='000' />
					<value target='LED_Count' data='25' />
					<value target='LED_Cols' data='3' />
					<value target='x_spacing' data='8' />
					<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 />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='5767167' img='' style='0' />
		<camera xe='1.18076' ye='-2.41975' ze='276.376' xt='1.18076' yt='-2.41975' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='746' dy='163' zoom='326.605' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='15793151' />
		<winpos ID='7005' RectRecentFloat='854,-496,1628,-235' RectRecentDocked='1014,141,1520,1021' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='1' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='1' />
	</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='-6.15954' ye='-6.20034' ze='6.1088' xt='1.15138' yt='1.11283' zt='-1.20477' xquat='-0.424689' yquat='0.175852' zquat='0.339833' wquat='0.820505' />
		<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='419,-964,823,-82' RectRecentDocked='423,-937,819,-86' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel3d>
	<panels2d count='0' />
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAxAQAAGsDAAA' zoom='65' scrollx='0' scrolly='504' flags='0' />
	</layout>
</document>
</root>
