<root>
<document scada='0' schema='102' license='1,91630489,68C6ZJ' title='Assignment 2' description='' fcversion='590080' target='PIC16.33E.Formula AllCode' >
	<config data='' clkspd='140000000' simspd='1' usewdt='0' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='distance' />
	</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='1' />
			<data name='ClockPin' value='1' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='0' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='2' />
			<data name='CalculatedCommsDelay' value='2' />
			<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='fd7aec1e-c7bf-4958-9af4-0031c1621e24' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' category2='' category3='' bIs2dOnly='0' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<gdiopts FullContainer='1' FullTransparency='1' ShowGdi='1' ShowOpengl='1' />
		<component class_type='root' codename='panel' 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 />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='speed' type='u16' description='forward or reverse motor speed' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<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='tempval' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='distance' type='u16' description='distance from allcode to object (4095 is close o is far)' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' >
						<array size='8' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='8' />
						<array size='3' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DEBUG' type='s16' description='set to 1 if debugging' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='xpos' type='u16' description='x cursor position' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='motion' type='b1' description='motor direction 1 = forward, O = reverse' isconst='0' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='i' type='u16' description='temp' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='sensorName' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='8' />
					</def>
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='readSensors' description='reads all the distance sensors' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='loop' title='Loop' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' type='2' forvar='i' exp='8' >
							<flowline >
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='FormulaAllCode1' macro='ReadIRSensor' >
									<return exp='distance[i]' />
									<argument exp='i' />
								</command>
								<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='10' type='1' />
							</flowline>
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='FormulaAllCode1' macro='LCDClear' />
						<command class_type='decision' title='Debugging' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='DEBUG = 1' swap='0' >
							<flowline >
								<command class_type='loop' title='Loop' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' type='2' forvar='i' exp='8' >
									<flowline >
										<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='FormulaAllCode1' macro='LCDPrintString' >
											<argument exp='(i%2)*64' />
											<argument exp='(i/2)*8' />
											<argument exp='Sensor[i]' />
											<argument exp='1' />
										</command>
										<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='FormulaAllCode1' macro='LCDPrintNumber' >
											<argument exp='(i%2)*64 +20' />
											<argument exp='(i/2)*8' />
											<argument exp='distance[i]' />
											<argument exp='1' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='420' type='1' />
					</flowline>
				</macro>
				<macro >
					<flowline name='InitStr' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='SetStrings' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Sensor[0] = &quot;Lt&quot;' />
							<exp exp='Sensor[1] = &quot;LF&quot;' />
							<exp exp='Sensor[2] = &quot;Ft&quot;' />
							<exp exp='Sensor[3] = &quot;RF&quot;' />
							<exp exp='Sensor[4] = &quot;Rt&quot;' />
							<exp exp='Sensor[5] = &quot;RR&quot;' />
							<exp exp='Sensor[6] = &quot;Re&quot;' />
							<exp exp='Sensor[7] = &quot;LR&quot;' />
							<exp exp='' />
						</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='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='FormulaAllCode1' macro='Initialise' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='FormulaAllCode1' macro='LCDBacklight' >
							<argument exp='100' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='FormulaAllCode1' macro='LCDClear' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='FormulaAllCode1' macro='LCDPrintString' >
							<argument exp='0' />
							<argument exp='0' />
							<argument exp='&quot;initialised&quot;' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='initialiseStrings' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='InitStr' />
						<command class_type='calculation' title='set motion' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='speed = 100' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='readSensors' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='readSensors' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='e3be641a-8808-4138-bee5-805fbbce468c' vmin='3' vmaj='1' codename='FormulaAllCode1' x='-23.5294' y='30' z='25' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='180' xquat='0' yquat='0' zquat='1' wquat='6.12323e-17' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='wait_b4_start' data='0' />
					<value target='startup_time' data='2000' />
					<value target='CreationInfo' data='003' />
					<value target='BlueReset' data='0' />
					<value target='MotFeedback' data='0' />
					<value target='Model' data='000' />
					<value target='IRdistance' data='200' />
					<value target='LineSensitivity' data='50' />
					<value target='sim_speed' data='40' />
					<value target='timer_interval' data='50' />
					<value target='collision_mode' data='000' />
					<value target='collision_group' data='' />
					<value target='LightSource' data='' />
					<value target='AddonMech' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='4cbae05a-fee8-4685-b94c-829abc3466ab' vmin='0' vmaj='1' codename='shape_cuboid1' x='129.977' y='20' z='25' xsz='0.625' ysz='8' zsz='2' xang='0' yang='-2.26592' zang='0' xquat='0' yquat='-0.0197726' zquat='0' wquat='0.999805' visible='1' scadavisible='1' interactive='1' solid='1' 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>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<camera xe='0' ye='0' ze='1232.5' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='128' dy='128' zoom='12.5663' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='0' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='15793151' img='' style='0' size='51' />
		<camera xe='134.014' ye='-103.931' ze='200.396' xt='73.3607' yt='16.5369' zt='-8.91726' xquat='-0.165877' yquat='0.228439' zquat='-0.94682' wquat='0.154375' />
		<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' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAAUwYAAGsDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='InitStr' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAAUwYAAGsDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='readSensors' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAAUwYAAGsDAAA' zoom='93' scrollx='0' scrolly='405' flags='0' />
	</layout>
</document>
</root>
