<root>
<document scada='0' projtype='1' schema='103' license='1,82702381,95CJQR' title='' description='' fcversion='720899' target='PIC16.33E.Formula Allcode' >
	<config data='' clkspd='140000000' simspd='0' usewdt='0' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='typedef union&#10;{&#10;  MX_FLOAT AsFloat;&#10;  MX_UINT8  AsByte[4];&#10;} MX_FloatUnion;&#10;&#10;MX_FloatUnion FloatUnion;' body='' />
	<debug >
		<watch expr='.Position' />
		<watch expr='.X' />
		<watch expr='.Y' />
		<watch expr='SimAngle' />
		<watch expr='SimVelocity' />
		<watch expr='.Z' />
	</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='0' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='1b7cfad1-5f53-4738-8957-a6c2bd21184e' vstate='40' vmin='3' vmaj='1' srcleaf='FA_Source_P4.fcfx' visiblename='Formula AllCode' description='A component to allow all the features of the Formula AllCode robot to be investigated.&#13;&#10;Fully simulated component which can interact with simulated objects on the panel as well as control the real hardware. ' category='Robotics' category2='' category3='' bIs2dOnly='0' bIs3dOnly='1' bIsWysiwyg='0' catenable='1' author='Matrix TSL' manuname='Matrix TSL' manucode='RB4420' sysinfo='3158379' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' showmacros='1' iconpath='..\..\icons\components\FA_API.png' />
		<component class_type='root' codename='FormulaAllCode' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
			<resources >
				<file name='PCB.mesh' source='..\..\models\Formula Allcode\PCB.mesh' />
				<file name='FFPCB.mesh' source='..\..\models\Formula Allcode\FFPCB.mesh' />
				<file name='Wheel.mesh' source='..\..\models\Formula Allcode\Wheel.mesh' />
				<file name='IR.mesh' source='..\..\models\Formula Allcode\IR.mesh' />
				<file name='Wheel2.mesh' source='..\..\models\Formula Allcode\Wheel2.mesh' />
				<file name='Moulding.mesh' source='..\..\models\Formula Allcode\Moulding.mesh' />
				<file name='FF_001_LED.mesh' source='..\..\models\Formula Flowcode 002\FF_001_LED.mesh' />
			</resources>
			<properties >
				<property name='Wait For Button' target='wait_b4_start' typeid='7' hidden='0' locked='0' info='Determines if the program will automatically wait for one of the front switches to be pressed before executing the program.&#13;&#10;Ran as part of the initialise function after the various components have been initialised.' />
				<property name='Startup Time' target='startup_time' typeid='21' hidden='1' locked='0' info='Time in milliseconds to wait and show the build time/date after the initialise function.' />
				<property name='Show Creation Info' target='CreationInfo' typeid='16' hidden='0' locked='0' info='Specifies what information is shown to the user on calling the initialise function.&#13;&#10;The time and date shown are the compilation time and date to help pinpoint the firmware version.' filter='000Nothing&#10;001Time Only&#10;002Date Only&#10;003Time &amp; Date' />
				<property name='Bluetooth Reset' target='BlueReset' typeid='7' hidden='0' locked='0' info='Decides if the Bluetooth data connection can reset the Formula AllCode.&#13;&#10;Used by mLoader when programming via Bluetooth to allow reprogramming without having to physically touch the robot.&#13;&#10;To ensure programming security set this option to No.' />
				<property name='Use Motor Feedback' target='MotFeedback' typeid='7' hidden='0' locked='0' info='Controls when the motor feedback is used.&#13;&#10;No - Speed control feedback is not used for SetMotors commands.&#13;&#10;Yes - Speed control feedback is used for the SetMotors commands.&#13;&#10;SetMotors commands include Forward, Backward, SpinLeft, SpinRight as well as SetMotors itself.&#13;&#10;Logo functions always use feedback.' />
				<property name='Model' target='Model' typeid='16' hidden='1' locked='0' info='' filter='000P4 - Production&#10;001P3' />
				<property name='IR Simulation' folder='property_1' hidden='0' >
					<property name='IR Simulation Mode' target='IRSimMode' typeid='16' hidden='0' locked='0' info='Controls how the IR sensors are modelled in simulation.&#13;&#10;Linear is the legacy mode and works as it has always done.&#13;&#10;Exponential attempts to provide a more accurate reading which is closed to response of the real world hardware,' filter='000Linear&#10;001Exponential' />
					<property name='Exponential Multiplier (A)' target='ExpMult' typeid='15' hidden='1' locked='0' info='' />
					<property name='Linear Multiplier (B)' target='LinMult' typeid='15' hidden='1' locked='0' info='' />
				</property>
				<property name='IR Thresholds (CheckIR macro)' folder='property_2' hidden='0' >
					<property name='IR Distance' target='IRdistance' typeid='21' hidden='0' locked='0' info='IR Threshold used with the CheckIR macro' />
					<property name='Line Sensitivity' target='LineSensitivity' typeid='21' hidden='0' locked='0' info='' />
				</property>
				<property name='Simulation Properties' folder='property_3' hidden='0' >
					<property name='Sim Speed (1 - 100)' target='sim_speed' typeid='21' hidden='0' locked='0' info='Sets the simulated amount of movement relative to the speed of the Formula Allcode.' />
					<property name='Timer Interval (ms)' target='timer_interval' typeid='21' hidden='0' locked='0' info='Interval in milliseconds between each simulated movement of the Formula Allcode robot.' />
					<property name='Collision Method' target='collision_mode' typeid='16' hidden='0' locked='0' info='Select which objects the robot sensors will interact with.' filter='000All&#10;001Group' />
					<property name='Collision Group' target='collision_group' typeid='17' hidden='1' locked='0' info='Selects the group of objects that the robot will interact with.' />
					<property name='Light Source' target='LightSource' typeid='17' hidden='0' locked='0' info='Panel object specified as the simulation light source.&#13;&#10;Used when simulating &quot;find the light&quot; type tasks.' />
					<property name='Addon Mechanics' target='AddonMech' typeid='17' hidden='0' locked='0' info='Useful if you are creating add-ons to the robot which you want to be able to simulate.&#13;&#10;Point the property at the group containing the Formula Allcode and the additional mechanics.&#13;&#10;Otherwise leave blank to maintain the normal simulation functionality.' />
				</property>
			</properties>
			<values >
				<value target='wait_b4_start' data='1' />
				<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='IRSimMode' data='000' />
				<value target='ExpMult' data='4890.000000' />
				<value target='LinMult' data='-0.570000' />
				<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 >
				<event class='Simulation' event='Stop' target='Ev_Stop' />
				<event class='Simulation' event='Pause' target='Ev_Pause' />
				<event class='Components' event='Property' target='Ev_Property' />
				<event class='Simulation' event='Start' target='Ev_Start' />
				<event class='Components' event='Initialise' target='Ev_Initialise' />
				<event class='Compile' event='AddInterrupts' target='Ev_AddInterrupts' />
				<event class='System' event='Timer' target='Ev_Timer' />
				<event class='Simulation' event='Resume' target='Ev_Resume' />
			</events>
			<apis >
				<api name='PlayNote' alt='PlayNote_Sim' type='1' proto='1' />
				<api name='LEDOn' alt='LEDOn' type='1' proto='1' />
				<api name='BluetoothTransmit' alt='BluetoothTransmit' type='1' proto='1' />
				<api name='LCDPrintString' alt='LCDPrintString' type='1' proto='1' />
				<api name='LogoConfigure' alt='LogoConfigure' type='1' proto='1' />
				<api name='Stop' alt='Stop_Sim' type='1' proto='1' />
				<api name='ReadBattery' alt='ReadBattery_Sim' type='1' proto='1' />
				<api name='LEDOff' alt='LEDOff' type='1' proto='1' />
				<api name='LCDPrintNumber' alt='LCDPrintNumber' type='1' proto='1' />
				<api name='LEDWrite' alt='LEDWrite' type='1' proto='1' />
				<api name='BluetoothCheckConnection' alt='BluetoothCheckConnection' type='1' proto='1' />
				<api name='ReadMic' alt='ReadMic' type='1' proto='1' />
				<api name='AudioQueueLength' alt='AudioQueueLength' type='1' proto='1' />
				<api name='AudioAddToBuffer' alt='AudioAddToBuffer' type='1' proto='1' />
				<api name='ReadSwitch' alt='ReadSwitch' type='1' proto='1' />
				<api name='CheckLine' alt='CheckLine_Sim' type='1' proto='1' />
				<api name='AudioStreamControl' alt='AudioStreamControl' type='1' proto='1' />
				<api name='SpinLeft' alt='SpinLeft_Sim' type='1' proto='1' />
				<api name='LogoTurnLeft' alt='LogoTurnLeftSim' type='1' proto='1' />
				<api name='Forward' alt='Forward_Sim' type='1' proto='1' />
				<api name='BluetoothReceive' alt='BluetoothReceive' type='1' proto='1' />
				<api name='LCDDrawLine' alt='LCDDrawLine' type='1' proto='1' />
				<api name='BluetoothQueueLength' alt='BluetoothQueueLength' type='1' proto='1' />
				<api name='BluetoothTransmitString' alt='BluetoothTransmitString' type='1' proto='1' />
				<api name='LCDBacklight' alt='LCDBacklight' type='1' proto='1' />
				<api name='AudioReadFromBuffer' alt='AudioReadFromBuffer' type='1' proto='1' />
				<api name='ReadLineSensor' alt='ReadLineSensor_Sim' type='1' proto='1' />
				<api name='LogoTurnRight' alt='LogoTurnRightSim' type='1' proto='1' />
				<api name='SpinRight' alt='SpinRight_Sim' type='1' proto='1' />
				<api name='CheckIR' alt='CheckIR_Sim' type='1' proto='1' />
				<api name='LCDPlotPixel' alt='LCDPlotPixel' type='1' proto='1' />
				<api name='LCDSetBackgroundColour' alt='LCDSetBackgroundColour' type='1' proto='1' />
				<api name='ReadIRSensor' alt='ReadIRSensor_Sim' type='1' proto='1' />
				<api name='SetMotors' alt='SetMotors_Sim' type='1' proto='1' />
				<api name='LogoBackwards' alt='LogoBackwardsSim' type='1' proto='1' />
				<api name='EncoderReset' alt='EncoderReset' type='1' proto='1' />
				<api name='Reverse' alt='Reverse_Sim' type='1' proto='1' />
				<api name='WaitForSwitch' alt='WaitForSwitch' type='1' proto='1' />
				<api name='ReadLDR' alt='ReadLDR_Sim' type='1' proto='1' />
				<api name='LCDDrawRectangle' alt='LCDDrawRectangle' type='1' proto='1' />
				<api name='EncoderReadCount' alt='EncoderReadCount' type='1' proto='1' />
				<api name='CheckUSB' alt='CheckUSB_Sim' type='1' proto='1' />
				<api name='LCDSetForegroundColour' alt='LCDSetForegroundColour' type='1' proto='1' />
				<api name='Initialise' alt='InitialiseSim' type='1' proto='1' />
				<api name='LogoForwards' alt='LogoForwardsSim' type='1' proto='1' />
				<api name='LogoSetSpeed' alt='LogoSetSpeed' type='1' proto='1' />
				<api name='LCDClear' alt='LCDClear' type='1' proto='1' />
			</apis>
			<variables >
				<variable public='0' >
					<def class_type='variable' name='AngleResolution' type='f32' description='mm per degree 0.759218' isconst='0' isHidden='0' isinit='1' usrinit='0.729499995708465576171875' setinit='0.7295' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Right' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RightDir' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AreYouThereCount' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LeftDir' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SimAngle' type='f32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0.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='Rotation' type='s32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EncoderResolution' type='f32' description='mm per encoder step 0.32' isconst='0' isHidden='0' isinit='1' usrinit='0.319999992847442626953125' setinit='0.32' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AudioMode' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ConsoleHandle' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ResetCount' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Left' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EncCount' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' >
						<array size='2' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EncSave' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Movement' type='s32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AudioSampleCount' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SimStop' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LogoMove' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LogoSpeed' type='s16' description='' isconst='0' isHidden='0' isinit='1' usrinit='40' setinit='40' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AudioBitDepth' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='tmr_running' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SimVelocity' type='f32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0.0' setinit='0' />
				</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='CmdActive' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='PlayNote' description='Outputs a single tone from the onboard speaker for the period specified.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Note' type='u16' description='Sets the pitch of the note in Hz. Range: 1 - 10000' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Time' type='u16' description='Time period to play the note for in milliseconds. Range: 0 - 65535 ms' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='loop' type='u32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='TransFreq' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='TransDelay' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Delay' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='LoopCount' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Temp' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='decision' title='Decision' exp='.Note &lt; 10' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Note = 10' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='.Time &lt; 5' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Time = 5' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.TransFreq = (2 * .note)' />
							<exp exp='.TransDelay = (1.0 / FLOAT .TransFreq)' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Delay = FLOAT (.TransDelay * 1000000.0)' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Temp = ((2.0 * .TransDelay) * 1000.0)' />
						</command>
						<command class_type='decision' title='Decision' exp='.Temp &lt; 0.000001' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Temp = 0.000001' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.LoopCount = FLOAT .Time / .Temp' />
						</command>
						<command class_type='output' title='Output' mode='1' port='1048581' mask='8' exp='0' usechipref='1' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Loop = 0' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.Loop &lt; .LoopCount' for1='' for3='' >
							<flowline >
								<command class_type='delay' title='Delay' exp='.Delay' type='0' />
								<command class_type='output' title='Output' mode='1' port='1048581' mask='8' exp='1' usechipref='1' />
								<command class_type='delay' title='Delay' exp='.Delay' type='0' />
								<command class_type='output' title='Output' mode='1' port='1048581' mask='8' exp='0' usechipref='1' />
								<command class_type='calculation' title='Calculation' >
									<exp exp='.loop = .loop + 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='CheckLine_Sim' description='Checks to see if a line sensor is within the master threshold distance.&#13;&#10;Returns 0 if the IR reading is below the threshold.&#13;&#10;Returns 1 if the IR reading is greater than or equal to the threshold.' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Sensor' type='u8' description='Range: 0 to 1 - 0=Left, 1=Right' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Ret' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='ReadLineSensor_Sim' >
							<return exp='.Ret' />
							<argument exp='.Sensor' />
						</command>
						<command class_type='decision' title='Decision' exp='.Ret &gt;= LineSensitivity' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='InitialiseSim' description='Starts up the Formula Allcode PWM for motor control and performs the wait for button press if enabled.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='sw' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='Cmd' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='Test' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.sw = 0' />
							<exp exp='.Cmd = &quot;&quot;' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='ResetCount = 0' />
							<exp exp='AreYouThereCount = 0' />
							<exp exp='CmdActive = 0' />
						</command>
						<command class_type='delay' title='Wait for PLL to lock' exp='10' type='1' />
						<command class_type='comment' title='' comment='Initialise Motors' textarea='12,0,12,0' />
						<command class_type='output' title='Init Motor Dir Pins' mode='2' port='1048579' mask='15' exp='0x00' usechipref='1' />
						<command class_type='output' title='Enable Motor Driver' mode='1' port='1048582' mask='128' exp='1' usechipref='1' />
						<command class_type='sim' title='Simulation' macro='Connection.SetAn' >
							<argument exp='21' />
							<argument exp='0.606' />
							<argument exp='0' />
						</command>
						<command class_type='comment' title='' comment='Initialise LCD&#10;' textarea='12,0,12,0' />
						<command class_type='decision' title='Decision' exp='(CreationInfo = 2) | (CreationInfo = 3)' swap='0' >
							<flowline />
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='(CreationInfo = 1) | (CreationInfo = 3)' swap='0' >
							<flowline />
							<flowline />
						</command>
						<command class_type='call' title='Call Macro' disable='1' macro='BattMon' />
						<command class_type='comment' title='' comment='Initialise backlight' textarea='12,0,12,0' />
						<command class_type='call' title='Call Macro' macro='LCDBacklight' >
							<argument exp='50' />
						</command>
						<command class_type='comment' title='' comment='Enable Interrupts' textarea='12,0,12,0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='EncSave = $PORTB &gt;&gt; 11' />
						</command>
						<command class_type='native' title='C Code' ccode='// Bluetooth RX Interrupt Enable&#10;// Interrupt: Enable RXINT0&#10;IEC0bits.U1RXIE = 1;&#10;&#10;// Encoder Interrupt Enable&#10;// Interrupt: Enable IOC0&#10;CNENA = 0x0;&#10;CNENB = 0x1800;&#10;CNENC = 0x0;&#10;CNEND = 0x0;&#10;CNENE = 0x0;&#10;CNENF = 0x0;&#10;CNENG = 0x0;&#10;IEC1bits.CNIE = 1;' language='C' />
						<command class_type='comment' title='' comment='Restore Logo Resultion From Flash EE memory' textarea='12,0,12,0' />
						<command class_type='decision' title='Decision' exp='.Test = 0' swap='0' >
							<flowline >
								<command class_type='call' title='Load new default Distance' macro='GetEEFloat' >
									<return exp='EncoderResolution' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Load new default angle' macro='GetEEFloat' >
									<return exp='AngleResolution' />
									<argument exp='10' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='comment' title='' comment='Wait for switch' textarea='12,0,12,0' />
						<command class_type='decision' title='Wait for switch press?' exp='wait_b4_start = 1' swap='0' >
							<flowline >
								<command class_type='loop' title='Loop' type='0' exp='.sw = 0' for1='' for3='' >
									<flowline >
										<command class_type='input' title='Input' mode='2' port='1048576' mask='3' exp='.sw' usechipref='1' />
										<command class_type='delay' title='Delay' exp='20' type='1' />
									</flowline>
								</command>
								<command class_type='delay' title='Delay' exp='50' type='1' />
								<command class_type='loop' title='Loop' type='0' exp='.sw &gt; 0' for1='' for3='' >
									<flowline >
										<command class_type='input' title='Input' mode='2' port='1048576' mask='3' exp='.sw' usechipref='1' />
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='delay' title='Delay' exp='startup_time' type='1' />
							</flowline>
						</command>
						<command class_type='call' title='Call Macro' macro='LCDBacklight' >
							<argument exp='0' />
						</command>
						<command class_type='decision' title='Decision' exp='0' swap='0' >
							<flowline >
								<command class_type='call' title='Call Macro' macro='SetMotorsInterrupt' >
									<argument exp='0' />
									<argument exp='0' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LEDOn' description='Switches on a single LED on the front of the Formula Allcode. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='LED' type='u8' description='Which LED to switch on, range 0-7' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='.LED' >
							<case >
								<flowline />
							</case>
							<case exp='0' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='1' exp='1' usechipref='1' />
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='2' exp='1' usechipref='1' />
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='4' exp='1' usechipref='1' />
								</flowline>
							</case>
							<case exp='3' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='8' exp='1' usechipref='1' />
								</flowline>
							</case>
							<case exp='4' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='16' exp='1' usechipref='1' />
								</flowline>
							</case>
							<case exp='5' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='32' exp='1' usechipref='1' />
								</flowline>
							</case>
							<case exp='6' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='64' exp='1' usechipref='1' />
								</flowline>
							</case>
							<case exp='7' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='128' exp='1' usechipref='1' />
								</flowline>
							</case>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='BluetoothTransmit' description='Sends a byte via the Bluetooth data connection.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Data' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Timer' description='Called back on the panel command System.TimerStart' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='TimerID' type='u32' description='The identifier passed to the System.TimerStart panel command' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='hFA' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='hL' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='hr' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='mov' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='rot' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='decision' title='Decision' exp='tmr_running' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.rot = (Rotation / 255.0) * (sim_speed / 4.0)' />
									<exp exp='.mov = (Movement / 255.0) * (sim_speed / 4.0)' />
								</command>
								<command class_type='decision' title='Decision' exp='AddonMech' swap='0' >
									<flowline >
										<command class_type='sim' title='Simulation' macro='Panel.Position.RotateZ' >
											<argument exp='AddonMech' />
											<argument exp='this' />
											<argument exp='.rot' />
										</command>
										<command class_type='sim' title='Simulation' macro='Panel.Position.MoveAlong' >
											<argument exp='AddonMech' />
											<argument exp='this' />
											<argument exp='- .mov' />
											<argument exp='0' />
											<argument exp='0' />
										</command>
									</flowline>
									<flowline >
										<command class_type='sim' title='Simulation' macro='Panel.Position.RotateZ' >
											<argument exp='this' />
											<argument exp='this' />
											<argument exp='.rot' />
										</command>
										<command class_type='sim' title='Simulation' macro='Panel.Position.MoveAlong' >
											<argument exp='this' />
											<argument exp='this' />
											<argument exp='- .mov' />
											<argument exp='0' />
											<argument exp='0' />
										</command>
									</flowline>
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.RotateY' >
									<argument exp='WheelR' />
									<argument exp='WheelR' />
									<argument exp='-(.rot + .mov) * 2' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.RotateY' >
									<argument exp='WheelL' />
									<argument exp='WheelL' />
									<argument exp='(.rot - .mov) * 2' />
								</command>
								<command class_type='decision' title='Decision' exp='SimStop = 0' swap='0' >
									<flowline >
										<command class_type='sim' title='Simulation' macro='System.TimerStart' >
											<argument exp='0' />
											<argument exp='timer_interval' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LCDPrintString' description='Prints a string to the graphical LCD.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='X' type='u8' description='The horizontal start pixel. Range 0-127' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Y' type='u8' description='Y coordinate to print the string. Range 0-31' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Data' type='T8*' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<param name='Transparent' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Component Macro' component='Display' macro='Print' >
							<argument exp='.Data' />
							<argument exp='.X' />
							<argument exp='.Y' />
							<argument exp='0' />
							<argument exp='.Transparent' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='CheckIR_Sim' description='Checks to see if a IR sensor is within the master threshold distance.&#13;&#10;Returns 0 if the IR reading is below the threshold.&#13;&#10;Returns 1 if the IR reading is greater than or equal to the threshold.' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Sensor' type='u8' description='Range: 0 to 7 - 0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Ret' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='ReadIRSensor_Sim' >
							<return exp='.Ret' />
							<argument exp='.Sensor' />
						</command>
						<command class_type='decision' title='Decision' exp='.Ret &gt;= IRdistance' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='PlayNote_Sim' description='Outputs a single tone from the onboard speaker for the period specified' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Note' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Time' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='SoundH' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Buffer' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='1024' />
						</local>
						<local name='Idx' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='Val' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Tone' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Count' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Tone = 1.0 / FLOAT .Note' />
						</command>
						<command class_type='sim' title='Simulation' textarea='157,33,157,33' macro='Sound.Create' >
							<return exp='.SoundH' />
							<argument exp='16000' />
							<argument exp='8' />
							<argument exp='0' />
						</command>
						<command class_type='sim' title='Simulation' textarea='157,33,157,33' macro='Sound.SetVolume' >
							<argument exp='.SoundH' />
							<argument exp='0.5' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.Idx &lt; 1024' for1='' for3='' >
							<flowline >
								<command class_type='calculation' title='Add to buffer' >
									<exp exp='.val = sin (.Idx * .Tone * 3.14159265 / 256.0)' />
									<exp exp='.buffer[.Idx] = ((.val + 1) / 2) * 255' />
									<exp exp='' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Idx = .Idx + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.Count &lt; (.Time / 100)' for1='' for3='' >
							<flowline >
								<command class_type='sim' title='Queue sound' macro='Sound.Queue' >
									<argument exp='.SoundH' />
									<argument exp='.buffer' />
									<argument exp='0' />
									<argument exp='1024' />
									<argument exp='1' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Count = .Count + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='loop' title='Loop' type='0' exp='::Sound .GetPending (.SoundH)' for1='' for3='' >
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Stop' description='Broadcast to all components that simulation has stopped' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='LEDWrite' >
							<argument exp='0' />
						</command>
						<command class_type='sim' title='Simulation' macro='System.TimerStop' >
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='SimStop = 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LogoConfigure' description='The Logo movement may sometimes be slightly off in terms of distance or angle.&#13;&#10;Before tweaking the factory values check that the wheels are pushed well onto their shafts but not tight against the FA body. Also check the tyre is on the wheel correctly.&#13;&#10;' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Distance' type='f32' description='mm per encoder step. default = 0.32' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<param name='Angle' type='f32' description='mm of travel per degree. default = 0.7295' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='EncoderResolution = .Distance' />
							<exp exp='AngleResolution = .Angle' />
						</command>
						<command class_type='call' title='Call Macro' macro='SetEEFloat' >
							<argument exp='0' />
							<argument exp='.Distance' />
						</command>
						<command class_type='call' title='Call Macro' macro='SetEEFloat' >
							<argument exp='10' />
							<argument exp='.Angle' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Forward_Sim' description='Drives both motors of the formula flowcode forwards with the power specified. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Power' type='u8' description='Amount of power to use to drive motor. Range 0-100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Check the power is in range' exp='.Power &gt; 100' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set the power' >
									<exp exp='.Power = 100' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='call' title='Call Macro' macro='SetMotors_Sim' >
							<argument exp='.Power' />
							<argument exp='.Power' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SpinLeft_Sim' description='Spins the formula flowcode on the spot in an anticlockwise direction as seen from above. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Power' type='u8' description='Amount of power to use to drive motor. Range 0-100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='SetMotors_Sim' >
							<argument exp='- .Power' />
							<argument exp='.Power' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_AddInterrupts' description='Sent to a component to allow dynamic amendment of the interrupts for a component' statediag='0' >
						<return name='Return' type='u32' description='Non-zero to block code insertion' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='HandlerCode' type='T8*' description='Text to amend for all component interrupts' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='temp' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<command class_type='sim' title='Simulation' macro='Expand.MacroBody' >
							<return exp='.temp' />
							<argument exp='&quot;Interrupt_BluetoothRX&quot;' />
							<argument exp='this' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HandlerCode = .HandlerCode + .temp' />
						</command>
						<command class_type='sim' title='Simulation' macro='Expand.MacroBody' >
							<return exp='.temp' />
							<argument exp='&quot;Interrupt_Encoder&quot;' />
							<argument exp='this' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HandlerCode = .HandlerCode + .temp' />
						</command>
						<command class_type='sim' title='Simulation' macro='Expand.MacroBody' >
							<return exp='.temp' />
							<argument exp='&quot;Interrupt_Audio&quot;' />
							<argument exp='this' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HandlerCode = .HandlerCode + .temp' />
						</command>
						<command class_type='sim' title='Simulation' macro='Expand.MacroBody' >
							<return exp='.temp' />
							<argument exp='&quot;Interrupt_MotorTimer&quot;' />
							<argument exp='this' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HandlerCode = .HandlerCode + .temp' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Stop' description='Stops both motors.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Macro' macro='SetMotors' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadBattery' description='Reads the current voltage level from the LiPo battery.&#13;&#10;Return value is the battery voltage in Volts.&#13;&#10;Take care not to run the battery too low. &#13;&#10;Voltages lower than 3.4V may damage the battery.' statediag='0' >
						<return name='Return' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='call' title='Read Battery Voltage' component='Battery' macro='GetVoltage' >
							<return exp='.Return' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='BattMon' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='Cmd' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='FVar' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='USB' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='BattPercent' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Component Macro' macro='ReadBattery' >
							<return exp='.Fvar' />
						</command>
						<command class_type='decision' title='Decision' exp='.Fvar &lt; 3.5' swap='0' >
							<flowline >
								<command class_type='loop' title='Loop' type='0' exp='1' for1='' for3='' >
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' exp='.USB' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.FVar = .Fvar - 3.5' />
											<exp exp='.FVar = .FVar * 125.0' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Cmd = &quot;Charge:  &quot;' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.FVar = .Fvar - 3.5' />
											<exp exp='.FVar = .FVar * 166.66' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Cmd = &quot;Battery: &quot;' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.BattPercent = .Fvar' />
								</command>
								<command class_type='decision' title='Decision' exp='.BattPercent &gt; 100' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.BattPercent = 100' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Cmd = .Cmd + ToString$ (.BattPercent)' />
									<exp exp='.Cmd = .Cmd + &quot;%  &quot;' />
									<exp exp='' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LEDOff' description='Switches off a single LED on the front of the Formula Allcode. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='LED' type='u8' description='Which LED to switch on, range 0-7' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='.LED' >
							<case >
								<flowline />
							</case>
							<case exp='0' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='1' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='2' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='4' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='3' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='8' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='4' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='16' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='5' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='32' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='6' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='64' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='7' >
								<flowline >
									<command class_type='output' title='Output' mode='1' port='1048580' mask='128' exp='0' usechipref='1' />
								</flowline>
							</case>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LCDPrintNumber' description='Prints a numeric value to the graphical LCD.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='X' type='u8' description='The horizontal start pixel. Range 0-127' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Y' type='u8' description='Y coordinate to print the string. Range 0-31' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Number' type='s16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Transparent' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Component Macro' component='Display' macro='PrintNumber' >
							<argument exp='.Number' />
							<argument exp='.X' />
							<argument exp='.Y' />
							<argument exp='0' />
							<argument exp='.Transparent' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Initialise' description='Initialisation routine for the component once the component is linked to its parent' statediag='0' >
						<return name='Return' type='u32' description='Non-zero to prevent initialisation' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Handle' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Name' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<command class_type='sim' title='Simulation' macro='Console.AddText' >
							<return exp='ConsoleHandle' />
							<argument exp='&quot;Formula Allcode&quot;' />
							<argument exp='0' />
						</command>
						<command class_type='sim' title='Simulation' macro='Console.WriteText' >
							<argument exp='ConsoleHandle' />
							<argument exp='&quot;IR Sensors:\n0 - X\n1 - X\n2 - X\n3 - X\n4 - X\n5 - X\n6 - X\n7 - X\n\nLine Sensors:\nL - X\nR - X\n\nMotor Speeds:\nL - X\nR - X\n\nOther Sensors:\nLight - X\nAudio - X\n&quot;' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Handle = BlueTooth' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.Handle' for1='' for3='' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Tree.Traverse' >
									<argument exp='.Handle' />
									<argument exp='Bluetooth' />
								</command>
								<command class_type='sim' title='Simulation' macro='Tree.GetName' >
									<return exp='.Name' />
									<argument exp='.Handle' />
								</command>
								<command class_type='decision' title='Decision' exp='Compare$ (&quot;cal_uart&quot;, .Name,0) == 0' swap='0' >
									<flowline >
										<command class_type='sim' title='TX = $PORTF.12' macro='Component.Property.SetValue' >
											<argument exp='.Handle' />
											<argument exp='&quot;OutputPins&quot;' />
											<argument exp='6' />
										</command>
										<command class_type='sim' title='RX = $PORTF.8' macro='Component.Property.SetValue' >
											<argument exp='.Handle' />
											<argument exp='&quot;InputPins&quot;' />
											<argument exp='104' />
										</command>
										<command class_type='sim' title='FlowControl = OFF' macro='Component.Property.SetValue' >
											<argument exp='.Handle' />
											<argument exp='&quot;FLOWEN&quot;' />
											<argument exp='0' />
										</command>
										<command class_type='sim' title='BAUD = 115200' macro='Component.Property.SetValue' >
											<argument exp='.Handle' />
											<argument exp='&quot;BAUD_LIST&quot;' />
											<argument exp='9' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Handle = 0' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LEDWrite' description='Allows control of all 8-LEDs on the front of the Formula Allcode. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='LED_Byte' type='u8' description='8-bit binary value to write to the 8 LEDs' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='output' title='Output' mode='0' port='1048580' mask='0' exp='.LED_Byte' usechipref='1' />
					</flowline>
				</macro>
				<macro keep='1' >
					<flowline name='Interrupt_MotorTimer' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='PowertoSpeedL' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='PowerToSpeedR' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='SpeedL' type='s16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='SpeedR' type='s16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='void _ISR _T8Interrupt(void)&#10;{' language='C' />
						<command class_type='native' title='C Code' ccode='float FCL_POWERTOSPEEDL;&#10;float FCL_POWERTOSPEEDR;&#10;unsigned int FCL_SPEEDL;&#10;unsigned int FCL_SPEEDR;' language='C' />
						<command class_type='decision' title='Decision' exp='(Left &gt; 0) &amp;&amp; (Right &gt; 0)' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.PowertoSpeedL = FLOAT EncCount[0] / FLOAT Left' />
									<exp exp='.PowertoSpeedR = FLOAT EncCount[1] / FLOAT Right' />
								</command>
								<command class_type='decision' title='Decision' exp='LeftDir' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.SpeedL = -Left' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.SpeedL = Left' />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Decision' exp='.PowertoSpeedL &gt; (.PowerToSpeedR + 10)' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' exp='RightDir' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='.SpeedR = -Right - 2' />
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='.SpeedR = Right + 2' />
												</command>
											</flowline>
										</command>
										<command class_type='call' title='Call Macro' macro='SetMotorsInterrupt' >
											<argument exp='.SpeedL' />
											<argument exp='.SpeedR' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Decision' exp='.PowertoSpeedL &lt; (.PowerToSpeedR - 10)' swap='0' >
											<flowline >
												<command class_type='decision' title='Decision' exp='RightDir' swap='0' >
													<flowline >
														<command class_type='calculation' title='Calculation' >
															<exp exp='.SpeedR = -Right + 2' />
														</command>
													</flowline>
													<flowline >
														<command class_type='calculation' title='Calculation' >
															<exp exp='.SpeedR = Right - 2' />
														</command>
													</flowline>
												</command>
												<command class_type='call' title='Call Macro' macro='SetMotorsInterrupt' >
													<argument exp='.SpeedL' />
													<argument exp='.SpeedR' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='native' title='C Code' ccode='IFS3bits.T9IF = 0;&#10;&#10;}' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='BluetoothCheckConnection' description='Checks the status of the Bluetooth connection.&#13;&#10;Returns 0 for not paired and 1 for paired.' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='input' title='Input' mode='1' port='1048581' mask='1' exp='.Return' usechipref='1' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Sim_Draw2DRobot' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='X' type='f32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0.0' setinit='0' />
						<local name='Y' type='f32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0.0' setinit='0' />
						<local name='Position' type='f32' description='Left, Top, Width, Height' isconst='0' isHidden='0' isinit='1' usrinit='0.0' setinit='{0}' >
							<array size='4' />
						</local>
						<local name='Panel' type='s32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='HW' type='f32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0.0' setinit='0' />
						<local name='HH' type='f32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0.0' setinit='0' />
						<local name='OX' type='f32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0.0' setinit='0' />
						<local name='OY' type='f32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0.0' setinit='0' />
						<local name='Angle' type='f32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0.0' setinit='0' />
						<local name='Z' type='f32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0.0' setinit='0' />
						<command class_type='calculation' title='Add 45 degrees to Wheels and Front Indicator' >
							<exp exp='.Angle = SimAngle - 0.785398' />
						</command>
						<command class_type='sim' title='Built-in Function' macro='Panel.Position.GetActual2dPosition' >
							<return exp='.Position' />
							<argument exp='Robot_Body' />
						</command>
						<command class_type='calculation' title='Work out movement' >
							<exp exp='.Position[0] = .Position[0] - (sin(SimAngle) * SimVelocity)' />
							<exp exp='.Position[1] = .Position[1] + (cos(SimAngle) * SimVelocity)' />
						</command>
						<command class_type='sim' title='Built-in Function' macro='Panel.Position.SetActual2dPosition' >
							<argument exp='Robot_Body' />
							<argument exp='.Position[0]' />
							<argument exp='.Position[1]' />
							<argument exp='.Position[2]' />
							<argument exp='.Position[3]' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Half the width and height' >
							<exp exp='.HW = .Position[2] * 0.5' />
							<exp exp='.HH = .Position[3] * 0.5' />
						</command>
						<command class_type='calculation' title='Work out wheel positions' >
							<exp exp='.X = ((cos(.Angle) * .HW) - (sin(.Angle) * .HH)) * 0.5' />
							<exp exp='.Y = ((sin(.Angle) * .HW) + (cos(.Angle) * .HH)) * 0.5' />
						</command>
						<command class_type='calculation' title='Find the center of the object' >
							<exp exp='.OX = .Position[0] + .HW - 25.0' />
							<exp exp='.OY = .Position[1] + .HH - 25.0' />
						</command>
						<command class_type='sim' title='Built-in Function' macro='Panel.Position.SetActual2dPosition' >
							<argument exp='Robot_RightWheel' />
							<argument exp='.OX - .X' />
							<argument exp='.OY - .Y' />
							<argument exp='50.0' />
							<argument exp='50.0' />
							<argument exp='0' />
						</command>
						<command class_type='sim' title='Built-in Function' macro='Panel.Position.SetActual2dPosition' >
							<argument exp='Robot_LeftWheel' />
							<argument exp='.OX + .X' />
							<argument exp='.OY + .Y' />
							<argument exp='50.0' />
							<argument exp='50.0' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Find the center of the object' >
							<exp exp='.OX = .Position[0] + .HW - 10.0' />
							<exp exp='.OY = .Position[1] + .HH - 10.0' />
						</command>
						<command class_type='sim' title='Built-in Function' macro='Panel.Position.SetActual2dPosition' >
							<argument exp='Robot_Front' />
							<argument exp='.OX - .Y' />
							<argument exp='.OY + .X' />
							<argument exp='20.0' />
							<argument exp='20.0' />
							<argument exp='0' />
						</command>
						<command class_type='sim' title='Built-in Function' macro='Component.GetPanel' >
							<return exp='.Panel' />
							<argument exp='Robot_Body' />
						</command>
						<command class_type='sim' title='Redraw Background' macro='Panel.Refresh2dPanel' >
							<argument exp='.Panel' />
						</command>
						<command class_type='sim' title='Built-in Function' macro='Panel.Collision.GetSingleAxis' >
							<argument exp='Robot_Body' />
							<argument exp='Wall' />
							<argument exp='.X' />
							<argument exp='.Y' />
							<argument exp='.Z' />
							<argument exp='this' />
						</command>
						<command class_type='calculation' title='Calculation' break='1' disable='1' />
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadMic' description='Reads the current audio signal level from the on-board microphone. &#13;&#10;Return value range: 0 to 4095' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Read Mic' component='MIC' macro='GetInt' >
							<return exp='.Return' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='AudioQueueLength' description='Retreives the current length of valid data within the audio queue' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Return number of samples in buffer' >
							<exp exp='.Return = AudioSampleCount' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='AudioAddToBuffer' description='Writes a value to the 16-bit audio output buffer.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Data' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='AudioSampleCount = AudioSampleCount + 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadSwitch' description='Reads the value of one of the switches from the front of the Formula Allcode.' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Switch' type='u8' description='Which switch do we want to read 0=Left, 1=Right' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' exp='.Switch' swap='0' >
							<flowline >
								<command class_type='input' title='Input' mode='1' port='1048576' mask='1' exp='.Return' usechipref='1' />
							</flowline>
							<flowline >
								<command class_type='input' title='Input' mode='1' port='1048576' mask='2' exp='.Return' usechipref='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='CheckLine' description='Checks to see if a line sensor is within the master threshold distance.&#13;&#10;Returns 0 if the IR reading is below the threshold.&#13;&#10;Returns 1 if the IR reading is greater than or equal to the threshold.' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Sensor' type='u8' description='Range: 0 to 1 - 0=Left, 1=Right' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Ret' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='ReadLineSensor' >
							<return exp='.Ret' />
							<argument exp='.Sensor' />
						</command>
						<command class_type='decision' title='Decision' exp='.Ret &gt;= LineSensitivity' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='AudioStreamControl' description='Allows control of the audio output functionality via the onboard speaker.&#13;&#10;Data is loaded into the audio output buffer using the AddToBuffer function.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Mode' type='u8' description='0=Off, 8=8-bit Mode, 16=16-bit Mode' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='SampleRate' type='u8' description='Sets the sample rate 0=8KHz, 1=16KHz' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='InterruptRate' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='LogoProcess' description='Process the Logo movement' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Left' type='s16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Right' type='s16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='EncTarget' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='LSP' type='s16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='RSP' type='s16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='done' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='DIR' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='2' />
						</local>
						<local name='EncCountOld' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' >
							<array size='2' />
						</local>
						<local name='Mode' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='OldMode' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Counter' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='CountDown' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' exp='MotFeedback = 1' swap='0' >
							<flowline >
								<command class_type='call' title='Ensure Motors Are Stopped' macro='SetMotors' >
									<argument exp='0' />
									<argument exp='0' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='.EncTarget &gt; 100' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.CountDown = 50' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.CountDown = .EncTarget / 3' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='LogoMove = 1' />
						</command>
						<command class_type='decision' title='Decision' exp='.Left &gt;= 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.DIR[0] = 1' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.LSP = 15' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.DIR[0] = 0' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.LSP = -15' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' exp='.Right &gt;= 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.DIR[1] = 1' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.RSP = 15' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.DIR[1] = 0' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.RSP = -15' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Reset Encoder Counters' >
							<exp exp='EncCount[0] = 0' />
							<exp exp='EncCount[1] = 0' />
							<exp exp='' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Mode = 0' />
							<exp exp='.OldMode = 10' />
							<exp exp='.Counter = 0' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.done = 0' for1='' for3='' >
							<flowline >
								<command class_type='decision' title='Decision' exp='(EncCount[0] &gt;= .EncTarget) || (EncCount[1] &gt;= .EncTarget)' swap='0' >
									<flowline >
										<command class_type='call' title='Brake' macro='SetMotors' >
											<argument exp='0' />
											<argument exp='0' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='.done = 1' />
										</command>
									</flowline>
									<flowline >
										<command class_type='call' title='Start Motors' macro='SetMotors' >
											<argument exp='.LSP' />
											<argument exp='.RSP' />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Decision' exp='EncCount[0] &gt; EncCount[1]' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='Left Motor Too Fast, Right Motor Too Slow' textarea='12,0,12,0' />
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Mode = 3' />
										</command>
										<command class_type='decision' title='Decision' exp='.Mode != .OldMode' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='.Counter = 0' />
												</command>
												<command class_type='decision' title='Decision' exp='.DIR[0] = 1' swap='0' >
													<flowline >
														<command class_type='decision' title='Decision' exp='.LSP &gt; 0' swap='0' >
															<flowline >
																<command class_type='calculation' title='Calculation' >
																	<exp exp='.LSP = .LSP - 1' />
																	<exp exp='' />
																</command>
															</flowline>
															<flowline />
														</command>
													</flowline>
													<flowline >
														<command class_type='decision' title='Decision' exp='.LSP &lt; 0' swap='0' >
															<flowline >
																<command class_type='calculation' title='Calculation' >
																	<exp exp='.LSP = .LSP + 1' />
																</command>
															</flowline>
															<flowline />
														</command>
													</flowline>
												</command>
												<command class_type='decision' title='Decision' exp='.DIR[1] = 1' swap='0' >
													<flowline >
														<command class_type='decision' title='Decision' exp='.RSP &lt; LogoSpeed' swap='0' >
															<flowline >
																<command class_type='calculation' title='Calculation' >
																	<exp exp='.RSP = .RSP + 1' />
																	<exp exp='' />
																</command>
															</flowline>
															<flowline />
														</command>
													</flowline>
													<flowline >
														<command class_type='decision' title='Decision' exp='.RSP &gt; -LogoSpeed' swap='0' >
															<flowline >
																<command class_type='calculation' title='Calculation' >
																	<exp exp='.RSP = .RSP - 1' />
																</command>
															</flowline>
															<flowline />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='.Counter = .Counter + 1' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Decision' exp='EncCount[1] &gt; EncCount[0]' swap='0' >
											<flowline >
												<command class_type='comment' title='' comment='Right Motor Too Fast, Left Motor Too Slow' textarea='12,0,12,0' />
												<command class_type='calculation' title='Calculation' >
													<exp exp='.Mode = 2' />
												</command>
												<command class_type='decision' title='Decision' exp='.Mode != .OldMode' swap='0' >
													<flowline >
														<command class_type='calculation' title='Calculation' >
															<exp exp='.Counter = 0' />
														</command>
														<command class_type='decision' title='Decision' exp='.DIR[1] = 1' swap='0' >
															<flowline >
																<command class_type='decision' title='Decision' exp='.RSP &gt; 0' swap='0' >
																	<flowline >
																		<command class_type='calculation' title='Calculation' >
																			<exp exp='.RSP = .RSP - 1' />
																		</command>
																	</flowline>
																	<flowline />
																</command>
															</flowline>
															<flowline >
																<command class_type='decision' title='Decision' exp='.RSP &lt; 0' swap='0' >
																	<flowline >
																		<command class_type='calculation' title='Calculation' >
																			<exp exp='.RSP = .RSP + 1' />
																		</command>
																	</flowline>
																	<flowline />
																</command>
															</flowline>
														</command>
														<command class_type='decision' title='Decision' exp='.DIR[0] = 1' swap='0' >
															<flowline >
																<command class_type='decision' title='Decision' exp='.LSP &lt; LogoSpeed' swap='0' >
																	<flowline >
																		<command class_type='calculation' title='Calculation' >
																			<exp exp='.LSP = .LSP + 1' />
																		</command>
																	</flowline>
																	<flowline />
																</command>
															</flowline>
															<flowline >
																<command class_type='decision' title='Decision' exp='.LSP &gt; -LogoSpeed' swap='0' >
																	<flowline >
																		<command class_type='calculation' title='Calculation' >
																			<exp exp='.LSP = .LSP - 1' />
																		</command>
																	</flowline>
																	<flowline />
																</command>
															</flowline>
														</command>
													</flowline>
													<flowline >
														<command class_type='calculation' title='Calculation' >
															<exp exp='.Counter = .Counter + 1' />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline >
												<command class_type='decision' title='Decision' exp='(EncCount[0] &gt;= (.EncTarget - .CountDown)) || (EncCount[1] &gt;= (.EncTarget - .CountDown))' swap='0' >
													<flowline >
														<command class_type='comment' title='' comment='Slow Down' textarea='42,6,42,6' />
														<command class_type='calculation' title='Calculation' >
															<exp exp='.Mode = 1' />
														</command>
														<command class_type='decision' title='Decision' exp='.mode != .OldMode' swap='0' >
															<flowline >
																<command class_type='calculation' title='Calculation' >
																	<exp exp='.Counter = 0' />
																</command>
																<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.DIR[0] = 1' swap='0' >
																	<flowline >
																		<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.LSP &gt; 10' swap='0' >
																			<flowline >
																				<command class_type='calculation' title='Calculation' textarea='42,6,42,6' >
																					<exp exp='.LSP = .LSP - 1' />
																				</command>
																			</flowline>
																			<flowline />
																		</command>
																	</flowline>
																	<flowline >
																		<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.LSP &lt; -10' swap='0' >
																			<flowline >
																				<command class_type='calculation' title='Calculation' textarea='42,6,42,6' >
																					<exp exp='.LSP = .LSP + 1' />
																				</command>
																			</flowline>
																			<flowline />
																		</command>
																	</flowline>
																</command>
																<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.DIR[1] = 1' swap='0' >
																	<flowline >
																		<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.RSP &gt; 10' swap='0' >
																			<flowline >
																				<command class_type='calculation' title='Calculation' textarea='42,6,42,6' >
																					<exp exp='.RSP = .RSP - 1' />
																				</command>
																			</flowline>
																			<flowline />
																		</command>
																	</flowline>
																	<flowline >
																		<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.RSP &lt; -10' swap='0' >
																			<flowline >
																				<command class_type='calculation' title='Calculation' textarea='42,6,42,6' >
																					<exp exp='.RSP = .RSP + 1' />
																				</command>
																			</flowline>
																			<flowline />
																		</command>
																	</flowline>
																</command>
															</flowline>
															<flowline >
																<command class_type='calculation' title='Calculation' >
																	<exp exp='.Counter = .Counter + 1' />
																</command>
															</flowline>
														</command>
													</flowline>
													<flowline >
														<command class_type='comment' title='' comment='Speed Up' textarea='42,6,42,6' />
														<command class_type='calculation' title='Calculation' >
															<exp exp='.Mode = 0' />
														</command>
														<command class_type='decision' title='Decision' exp='.Mode != .OldMode' swap='0' >
															<flowline >
																<command class_type='calculation' title='Calculation' >
																	<exp exp='.Counter = 0' />
																</command>
																<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.DIR[0] = 1' swap='0' >
																	<flowline >
																		<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.LSP &lt; LogoSpeed' swap='0' >
																			<flowline >
																				<command class_type='calculation' title='Calculation' textarea='42,6,42,6' >
																					<exp exp='.LSP = .LSP + 1' />
																				</command>
																			</flowline>
																			<flowline />
																		</command>
																	</flowline>
																	<flowline >
																		<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.LSP &gt; -LogoSpeed' swap='0' >
																			<flowline >
																				<command class_type='calculation' title='Calculation' textarea='42,6,42,6' >
																					<exp exp='.LSP = .LSP - 1' />
																				</command>
																			</flowline>
																			<flowline />
																		</command>
																	</flowline>
																</command>
																<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.DIR[1] = 1' swap='0' >
																	<flowline >
																		<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.RSP &lt; LogoSpeed' swap='0' >
																			<flowline >
																				<command class_type='calculation' title='Calculation' textarea='42,6,42,6' >
																					<exp exp='.RSP = .RSP + 1' />
																				</command>
																			</flowline>
																			<flowline />
																		</command>
																	</flowline>
																	<flowline >
																		<command class_type='decision' title='Decision' textarea='42,6,42,6' exp='.RSP &gt; -LogoSpeed' swap='0' >
																			<flowline >
																				<command class_type='calculation' title='Calculation' textarea='42,6,42,6' >
																					<exp exp='.RSP = .RSP - 1' />
																				</command>
																			</flowline>
																			<flowline />
																		</command>
																	</flowline>
																</command>
															</flowline>
															<flowline >
																<command class_type='calculation' title='Calculation' >
																	<exp exp='.Counter = .Counter + 1' />
																</command>
															</flowline>
														</command>
													</flowline>
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Decision' exp='.Counter &lt; 8' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.OldMode = .Mode' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.OldMode = 10' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='LogoMove = 0' />
						</command>
						<command class_type='delay' title='Delay' exp='50' type='1' />
					</flowline>
				</macro>
				<macro >
					<flowline name='SpinLeft' description='Spins the formula flowcode on the spot in an anticlockwise direction as seen from above. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Power' type='u8' description='Amount of power to use to drive motor. Range 0-100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='SetMotors' >
							<argument exp='-.Power' />
							<argument exp='.Power' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='BluetoothCommand' description='Allows a Bluetooth AT command to be sent.&#13;&#10;This macro is private so make sure that all commands are send in Initialise before enabling the Bluetooth RX interrupt.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Command' type='T8*' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='Reply' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='in' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='LogoTurnLeft' description='Rotates the robot left by a specific angle using the encoders as feedback to ensure&#13;&#10;the robot turns evenly. Automatically stops at the specified turn angle.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Angle' type='u16' description='Angle in degrees you wish to rotate. Range 1-65536' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='EncTarget' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='FCalc' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='decision' title='Decision' disable='1' exp='.Angle &gt; 10' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' disable='1' >
									<exp exp='.Angle = .Angle - 5' />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' disable='1' exp='.Angle &gt; 5' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' disable='1' >
											<exp exp='.Angle = .Angle - 2' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.FCalc = int2float (.Angle)' />
							<exp exp='.FCalc = .FCalc * AngleResolution' />
							<exp exp='.FCalc = .FCalc / EncoderResolution' />
							<exp exp='.EncTarget = float2int (.FCalc)' />
						</command>
						<command class_type='call' title='Call Macro' macro='LogoProcess' >
							<argument exp='-LogoSpeed' />
							<argument exp='LogoSpeed' />
							<argument exp='.EncTarget' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Pause' description='Broadcast to all components that simulation has paused' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='sim' title='Simulation' macro='System.TimerStop' >
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='SimStop = 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Forward' description='Drives both motors of the formula flowcode forwards with the power specified. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Power' type='u8' description='Amount of power to use to drive motor. Range 0-100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Check the power is in range' exp='.Power &gt; 100' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set the power' >
									<exp exp='.Power = 100' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='call' title='Call Macro' macro='SetMotors' >
							<argument exp='.Power' />
							<argument exp='.Power' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='BluetoothReceive' description='Attempt to read a byte from the Bluetooth receive queue.' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='LCDDrawLine' description='Draws a line on the LCD.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='X1' type='u8' description='Range 0-127' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Y1' type='u8' description='Range 0-31' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='X2' type='u8' description='Range 0-127' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Y2' type='u8' description='Range 0-31' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Component Macro' component='Display' macro='DrawLine' >
							<argument exp='.X1' />
							<argument exp='.Y1' />
							<argument exp='.X2' />
							<argument exp='.Y2' />
						</command>
					</flowline>
				</macro>
				<macro keep='1' >
					<flowline name='Interrupt_Audio' description='Clocks out the audio at a fixed rate using a timer interrupt' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='Sample' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='TempB' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='void _ISR _T9Interrupt(void)&#10;{&#10;    unsigned int FCL_SAMPLE;&#10;    unsigned char FCL_TEMPB;' language='C' />
						<command class_type='decision' title='Playback?' exp='AudioMode = 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' exp='AudioSampleCount &gt; 1' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='AudioSampleCount = AudioSampleCount - 1' />
										</command>
										<command class_type='decision' title='Decision' exp='AudioBitDepth = 16' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='.Sample = .Sample &lt;&lt; 8' />
													<exp exp='.Sample = .Sample + .TempB' />
													<exp exp='.Sample = .Sample + 32768' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='.Sample = .Sample &gt;&gt; 5' />
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='.Sample = .Sample &lt;&lt; 3' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Macro' macro='ReadMic' >
									<return exp='.Sample' />
								</command>
								<command class_type='decision' title='Decision' exp='AudioBitDepth = 16' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Sample = .Sample &lt;&lt; 4' />
											<exp exp='.Sample = .Sample - 32768' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Sample = .Sample &gt;&gt; 4' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='AudioSampleCount = AudioSampleCount + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='native' title='C Code' ccode='IFS3bits.T9IF = 0;&#10;}' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='BluetoothQueueLength' description='Reads the length of received Bluetooth data in bytes. ' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Property' description='Sent when a property has been changed by the User' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='temp_str' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<command class_type='decision' title='Decision' exp='collision_mode = 0' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
									<argument exp='this' />
									<argument exp='&quot;collision_group&quot;' />
									<argument exp='0' />
								</command>
							</flowline>
							<flowline >
								<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
									<argument exp='this' />
									<argument exp='&quot;collision_group&quot;' />
									<argument exp='1' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' exp='wait_b4_start = 0' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
									<argument exp='this' />
									<argument exp='&quot;startup_time&quot;' />
									<argument exp='1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
									<argument exp='this' />
									<argument exp='&quot;startup_time&quot;' />
									<argument exp='0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' exp='sim_speed &lt; 1' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Component.Property.SetValue' >
									<argument exp='this' />
									<argument exp='&quot;sim_speed&quot;' />
									<argument exp='1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' exp='sim_speed &gt; 100' swap='0' >
									<flowline >
										<command class_type='sim' title='Simulation' macro='Component.Property.SetValue' >
											<argument exp='this' />
											<argument exp='&quot;sim_speed&quot;' />
											<argument exp='100' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' exp='IRSimMode' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
									<argument exp='this' />
									<argument exp='&quot;ExpMult&quot;' />
									<argument exp='1' />
								</command>
								<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
									<argument exp='this' />
									<argument exp='&quot;LinMult&quot;' />
									<argument exp='1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
									<argument exp='this' />
									<argument exp='&quot;ExpMult&quot;' />
									<argument exp='0' />
								</command>
								<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
									<argument exp='this' />
									<argument exp='&quot;LinMult&quot;' />
									<argument exp='0' />
								</command>
							</flowline>
						</command>
						<command class_type='sim' title='Simulation' macro='Component.Property.GetValue' >
							<return exp='.temp_str' />
							<argument exp='this' />
							<argument exp='&quot;Model&quot;' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Reverse_Sim' description='Drives both motors of the formula flowcode backwards with the power specified. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Power' type='u8' description='Amount of power to use to drive motor. Range 0-100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Check the power is in range' exp='.Power &gt; 100' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set the power' >
									<exp exp='.Power = 100' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='call' title='Call Macro' macro='SetMotors_Sim' >
							<argument exp='- .Power' />
							<argument exp='- .Power' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='BluetoothTransmitString' description='Sends a string via the Bluetooth data connection.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Data' type='T8*' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
					</flowline>
				</macro>
				<macro >
					<flowline name='LCDBacklight' description='Controls the brighness of the LCD backlight' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Brightness' type='u8' description='Range: 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' exp='.Brightness &gt; 0' swap='0' >
							<flowline />
							<flowline >
								<command class_type='output' title='Output' mode='1' port='1048582' mask='1' exp='1' usechipref='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadLineSensor_Sim' description='Reads the analogue value from the specified IR line sensor.&#13;&#10;Return value range: 0 to 4095&#13;&#10;4095 represents the object is reflecting the most light.' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Channel' type='u8' description='Range: 0 to 1 - 0=Left, 1=Right' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='position' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='IR' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='Collision' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='.Channel' >
							<case >
								<flowline >
									<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
										<return exp='.position' />
										<argument exp='LFL0' />
									</command>
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
										<return exp='.position' />
										<argument exp='LFR0' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='sim' title='Simulation' macro='Panel.Position.MoveBy' >
							<argument exp='.position' />
							<argument exp='0' />
							<argument exp='0' />
							<argument exp='-3.5' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.IR &lt; 300' for1='' for3='' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Panel.Position.MoveBy' >
									<argument exp='.position' />
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='-1' />
								</command>
								<command class_type='decision' title='Decision' exp='collision_mode = 0' swap='0' >
									<flowline >
										<command class_type='sim' title='Simulation' macro='Panel.Collision.GetMultiAxis' >
											<return exp='.Collision' />
											<argument exp='.position' />
											<argument exp='0.0' />
											<argument exp='0.0' />
											<argument exp='0.0' />
											<argument exp='0' />
										</command>
									</flowline>
									<flowline >
										<command class_type='call' title='Call Macro' macro='Sim_Scan_Objects_In_Group' >
											<return exp='.Collision' />
											<argument exp='.position' />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Decision' exp='.Collision = 1' swap='0' >
									<flowline >
										<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' labeltype='0' />
									</flowline>
									<flowline />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.IR = .IR + 15' />
								</command>
							</flowline>
						</command>
						<command class_type='label' title='Connection Point' labelid='0' labelname='A' labeltype='4' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Return = 300 - .IR' />
						</command>
						<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='.Channel' >
							<case >
								<flowline >
									<command class_type='sim' title='Simulation' macro='Console.SetLineText' >
										<argument exp='ConsoleHandle' />
										<argument exp='.Channel + 11' />
										<argument exp='&quot;L - &quot; + STRING .Return' />
									</command>
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='sim' title='Simulation' macro='Console.SetLineText' >
										<argument exp='ConsoleHandle' />
										<argument exp='.Channel + 11' />
										<argument exp='&quot;R - &quot; + STRING .Return' />
									</command>
								</flowline>
							</case>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='AudioReadFromBuffer' description='Allows the audio buffer to be used for other streaming data such as recording the mic.&#13;&#10;' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='temp' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' exp='AudioSampleCount &gt; 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' exp='AudioBitDepth = 16' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Return = .Return | (.temp &lt;&lt; 8)' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='AudioSampleCount = AudioSampleCount - 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadLineSensor' description='Reads the analogue value from the specified IR line sensor.&#13;&#10;Return value range: 0 to 4095&#13;&#10;4095 represents the object is reflecting the most light.' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Channel' type='u8' description='Range: 0 to 1 - 0=Left, 1=Right' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='SampleOn' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='output' title='IR Output On' mode='1' port='135266310' mask='2' exp='1' usechipref='1' />
						<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='.Channel' >
							<case >
								<flowline >
									<command class_type='call' title='Call Component Macro' component='LF1' macro='GetInt' >
										<return exp='.SampleOn' />
									</command>
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='call' title='Call Component Macro' component='LF2' macro='GetInt' >
										<return exp='.SampleOn' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='output' title='IR Off' mode='1' port='135266310' mask='2' exp='0' usechipref='1' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Return = 4095 - .SampleOn' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadIRSensor_Sim' description='Reads the analogue value from the specified IR distance sensor.&#13;&#10;Return value range: 0 to 4095&#13;&#10;4095 represents the object is very close.' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Channel' type='u8' description='Range: 0 to 7 - 0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='position' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='IR' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='Collision' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='x' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='y' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='f' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='switch' title='Switch' textarea='36,25,36,25' disable='1' exp='.Channel' >
							<case >
								<flowline >
									<command class_type='sim' title='Simulation' disable='1' macro='Panel.Position.Get' >
										<return exp='.position' />
										<argument exp='IROBJ0' />
									</command>
									<command class_type='sim' title='Simulation' disable='1' macro='Panel.Position.MoveBy' >
										<argument exp='.position' />
										<argument exp='0' />
										<argument exp='-7.0' />
										<argument exp='0' />
									</command>
									<command class_type='calculation' title='Calculation' disable='1' >
										<exp exp='.x = 0.0' />
										<exp exp='.y = -0.5' />
									</command>
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
										<return exp='.position' />
										<argument exp='IROBJ1' />
									</command>
									<command class_type='sim' title='Simulation' macro='Panel.Position.MoveBy' >
										<argument exp='.position' />
										<argument exp='-7.0' />
										<argument exp='-7.0' />
										<argument exp='0' />
									</command>
									<command class_type='calculation' title='Calculation' >
										<exp exp='.x = -0.5' />
										<exp exp='.y = -0.5' />
									</command>
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
										<return exp='.position' />
										<argument exp='IROBJ2' />
									</command>
									<command class_type='sim' title='Simulation' macro='Panel.Position.MoveBy' >
										<argument exp='.position' />
										<argument exp='-7.0' />
										<argument exp='0' />
										<argument exp='0' />
									</command>
									<command class_type='calculation' title='Calculation' >
										<exp exp='.x = -0.5' />
										<exp exp='.y = 0.0' />
									</command>
								</flowline>
							</case>
							<case exp='3' >
								<flowline >
									<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
										<return exp='.position' />
										<argument exp='IROBJ3' />
									</command>
									<command class_type='sim' title='Simulation' macro='Panel.Position.MoveBy' >
										<argument exp='.position' />
										<argument exp='-7.0' />
										<argument exp='7.0' />
										<argument exp='0' />
									</command>
									<command class_type='calculation' title='Calculation' >
										<exp exp='.x = -0.5' />
										<exp exp='.y = 0.5' />
									</command>
								</flowline>
							</case>
							<case exp='4' >
								<flowline >
									<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
										<return exp='.position' />
										<argument exp='IROBJ4' />
									</command>
									<command class_type='sim' title='Simulation' macro='Panel.Position.MoveBy' >
										<argument exp='.position' />
										<argument exp='0' />
										<argument exp='7.0' />
										<argument exp='0' />
									</command>
									<command class_type='calculation' title='Calculation' >
										<exp exp='.x = 0' />
										<exp exp='.y = 0.5' />
									</command>
								</flowline>
							</case>
							<case exp='5' >
								<flowline >
									<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
										<return exp='.position' />
										<argument exp='IROBJ5' />
									</command>
									<command class_type='sim' title='Simulation' macro='Panel.Position.MoveBy' >
										<argument exp='.position' />
										<argument exp='7.0' />
										<argument exp='7.0' />
										<argument exp='0' />
									</command>
									<command class_type='calculation' title='Calculation' >
										<exp exp='.x = 0.5' />
										<exp exp='.y = 0.5' />
									</command>
								</flowline>
							</case>
							<case exp='6' >
								<flowline >
									<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
										<return exp='.position' />
										<argument exp='IROBJ6' />
									</command>
									<command class_type='sim' title='Simulation' macro='Panel.Position.MoveBy' >
										<argument exp='.position' />
										<argument exp='7.0' />
										<argument exp='0' />
										<argument exp='0' />
									</command>
									<command class_type='calculation' title='Calculation' >
										<exp exp='.x = 0.5' />
										<exp exp='.y = 0' />
									</command>
								</flowline>
							</case>
							<case exp='7' >
								<flowline >
									<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
										<return exp='.position' />
										<argument exp='IROBJ7' />
									</command>
									<command class_type='sim' title='Simulation' macro='Panel.Position.MoveBy' >
										<argument exp='.position' />
										<argument exp='7.0' />
										<argument exp='-7.0' />
										<argument exp='0' />
									</command>
									<command class_type='calculation' title='Calculation' >
										<exp exp='.x = 0.5' />
										<exp exp='.y = -0.5' />
										<exp exp='' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='loop' title='Loop' disable='1' type='0' exp='.IR &lt; 4095' for1='' for3='' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Panel.Position.MoveBy' >
									<argument exp='.position' />
									<argument exp='.x' />
									<argument exp='.y' />
									<argument exp='0' />
								</command>
								<command class_type='decision' title='Decision' exp='collision_mode = 0' swap='0' >
									<flowline >
										<command class_type='sim' title='Simulation' macro='Panel.Collision.GetMultiAxis' >
											<return exp='.Collision' />
											<argument exp='.position' />
											<argument exp='0.0' />
											<argument exp='0.0' />
											<argument exp='0.0' />
											<argument exp='0' />
										</command>
									</flowline>
									<flowline >
										<command class_type='call' title='Call Macro' macro='Sim_Scan_Objects_In_Group' >
											<return exp='.Collision' />
											<argument exp='.position' />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Decision' exp='.Collision = 1' swap='0' >
									<flowline >
										<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' labeltype='0' />
									</flowline>
									<flowline />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.IR = .IR + 15' />
								</command>
							</flowline>
						</command>
						<command class_type='label' title='Connection Point' disable='1' labelid='0' labelname='A' labeltype='4' />
						<command class_type='calculation' title='Calculation' disable='1' >
							<exp exp='.Return = 4095 - .IR' />
						</command>
						<command class_type='decision' title='Decision' disable='1' exp='IRSimMode' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.f = .Return' />
									<exp exp='.f = .f * -0.00333' />
									<exp exp='.f = .f + 14.3' />
									<exp exp='.f = .f * LinMult' />
									<exp exp='.f = exp (.f)' />
									<exp exp='.f = .f * ExpMult' />
									<exp exp='.Return = .f' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='sim' title='Component Macro' disable='1' component='SensorLibraryIR' macro='SetValue' >
							<argument exp='.IR' />
							<argument exp='.Return' />
						</command>
						<command class_type='sim' title='Component Macro' component='SensorLibraryIR' macro='GetValue' >
							<return exp='.Return' />
							<argument exp='.IR' />
						</command>
						<command class_type='decision' title='Decision' exp='.Return &gt; IRdistance' swap='0' >
							<flowline >
								<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='.IR' >
									<case >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array1' macro='LEDOn' >
												<argument exp='4' />
											</command>
										</flowline>
									</case>
									<case exp='1' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array1' macro='LEDOn' >
												<argument exp='3' />
											</command>
										</flowline>
									</case>
									<case exp='2' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array1' macro='LEDOn' >
												<argument exp='2' />
											</command>
										</flowline>
									</case>
									<case exp='3' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array1' macro='LEDOn' >
												<argument exp='1' />
											</command>
										</flowline>
									</case>
									<case exp='4' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array1' macro='LEDOn' >
												<argument exp='0' />
											</command>
										</flowline>
									</case>
									<case exp='5' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array2' macro='LEDOn' >
												<argument exp='4' />
											</command>
										</flowline>
									</case>
									<case exp='6' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array2' macro='LEDOn' >
												<argument exp='3' />
											</command>
										</flowline>
									</case>
									<case exp='7' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array2' macro='LEDOn' >
												<argument exp='2' />
											</command>
										</flowline>
									</case>
								</command>
							</flowline>
							<flowline >
								<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='.IR' >
									<case >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array1' macro='LEDOff' >
												<argument exp='4' />
											</command>
										</flowline>
									</case>
									<case exp='1' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array1' macro='LEDOff' >
												<argument exp='3' />
											</command>
										</flowline>
									</case>
									<case exp='2' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array1' macro='LEDOff' >
												<argument exp='2' />
											</command>
										</flowline>
									</case>
									<case exp='3' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array1' macro='LEDOff' >
												<argument exp='1' />
											</command>
										</flowline>
									</case>
									<case exp='4' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array1' macro='LEDOff' >
												<argument exp='0' />
											</command>
										</flowline>
									</case>
									<case exp='5' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array2' macro='LEDOff' >
												<argument exp='4' />
											</command>
										</flowline>
									</case>
									<case exp='6' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array2' macro='LEDOff' >
												<argument exp='3' />
											</command>
										</flowline>
									</case>
									<case exp='7' >
										<flowline >
											<command class_type='call' title='Component Macro' component='LED_Array2' macro='LEDOff' >
												<argument exp='2' />
											</command>
										</flowline>
									</case>
								</command>
							</flowline>
						</command>
						<command class_type='sim' title='Simulation' macro='Console.SetLineText' >
							<argument exp='ConsoleHandle' />
							<argument exp='.Channel + 1' />
							<argument exp='STRING .Channel + &quot; - &quot; + STRING .Return' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Sim_Scan_Objects_In_Group' description='' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='position' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='tree_handle' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='scan_handle' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='children' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Name' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='Test' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.tree_handle = this' />
						</command>
						<command class_type='sim' title='Call Macro' textarea='180,12,180,12' macro='Tree.StepParent' >
							<argument exp='.tree_handle' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.scan_handle = collision_group' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.scan_handle' for1='' for3='' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Tree.Traverse' >
									<argument exp='.scan_handle' />
									<argument exp='collision_group' />
								</command>
								<command class_type='sim' title='Simulation' macro='Tree.CheckChildren' >
									<return exp='.children' />
									<argument exp='.scan_handle' />
								</command>
								<command class_type='decision' title='Decision' exp='.children = 0' swap='0' >
									<flowline >
										<command class_type='sim' title='Simulation' macro='Tree.GetName' >
											<return exp='.Name' />
											<argument exp='.scan_handle' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Test = Compare$ (&quot;PrintArea&quot;, .Name,1)' />
										</command>
										<command class_type='decision' title='Decision' exp='.Test = 0' swap='0' >
											<flowline />
											<flowline >
												<command class_type='sim' title='Simulation' macro='Panel.Collision.GetSingleAxis' >
													<return exp='.Return' />
													<argument exp='.position' />
													<argument exp='.scan_handle' />
													<argument exp='0.0' />
													<argument exp='0.0' />
													<argument exp='0.0' />
													<argument exp='.tree_handle' />
												</command>
												<command class_type='decision' title='Decision' exp='.Return' swap='0' >
													<flowline >
														<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' labeltype='0' />
													</flowline>
													<flowline />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
						<command class_type='label' title='Connection Point' labelid='0' labelname='A' labeltype='4' />
					</flowline>
				</macro>
				<macro >
					<flowline name='LogoTurnRight' description='Rotates the robot right by a specific angle using the encoders as feedback to ensure the robot turns evenly. Automatically stops at the specified turn angle.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Angle' type='u16' description='Angle in degrees you wish to rotate. Range 1-65536' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='EncTarget' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='FCalc' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='decision' title='Decision' disable='1' exp='.Angle &gt; 10' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' disable='1' >
									<exp exp='.Angle = .Angle - 5' />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' disable='1' exp='.Angle &gt; 5' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' disable='1' >
											<exp exp='.Angle = .Angle - 2' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.FCalc = int2float (.Angle)' />
							<exp exp='.FCalc = .FCalc * AngleResolution' />
							<exp exp='.FCalc = .FCalc / EncoderResolution' />
							<exp exp='.EncTarget = float2int (.FCalc)' />
						</command>
						<command class_type='call' title='Call Macro' macro='LogoProcess' >
							<argument exp='LogoSpeed' />
							<argument exp='-LogoSpeed' />
							<argument exp='.EncTarget' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='CheckUSB_Sim' description='Checks to see if a USB cable is connected to the robot.&#13;&#10;Returns 0 for no connection and 1 for an active connection.' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Return = 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SpinRight' description='Spins the formula flowcode on the spot in a clockwise direction as seen from above. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Power' type='u8' description='Amount of power to use to drive motor. Range 0-100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='SetMotors' >
							<argument exp='.Power' />
							<argument exp='- .Power' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='CheckIR' description='Checks to see if a IR sensor is within the master threshold distance.&#13;&#10;Returns 0 if the IR reading is below the threshold.&#13;&#10;Returns 1 if the IR reading is greater than or equal to the threshold.' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Sensor' type='u8' description='Range: 0 to 7 - 0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Ret' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='ReadIRSensor' >
							<return exp='.Ret' />
							<argument exp='.Sensor' />
						</command>
						<command class_type='decision' title='Decision' exp='.Ret &gt;= IRdistance' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro keep='1' >
					<flowline name='Interrupt_Encoder' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='En' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='void _ISR _CNInterrupt(void)&#10;{' language='C' />
						<command class_type='native' title='C Code' ccode='char FCL_EN = PORTB &gt;&gt; 11;' language='C' />
						<command class_type='decision' title='Decision' exp='(.En &amp; 1) != (EncSave &amp; 1)' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='EncCount[0] = EncCount[0] + 1' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='(.En &amp; 2) != (EncSave &amp; 2)' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='EncCount[1] = EncCount[1] + 1' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='EncSave = .En' />
						</command>
						<command class_type='native' title='C Code' ccode='IFS1bits.CNIF = 0;&#10;&#10;}' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='LCDPlotPixel' description='Allows a single pixel on the LCD to be set or cleared.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='X' type='u8' description='Sets the X coordinate - Range 0-127' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Y' type='u8' description='Sets the Y coordinate - Range 0-31' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Component Macro' component='Display' macro='Plot' >
							<argument exp='.X' />
							<argument exp='.Y' />
						</command>
					</flowline>
				</macro>
				<macro keep='1' >
					<flowline name='SetMotorsInterrupt' description='Sets the speed and direction of the Formula Allcode motors. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Left' type='s16' description='Valid Range = -100 to 100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Right' type='s16' description='Valid Range = -100 to 100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Mask' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='native' title='Disable All motor PWM' ccode='OC1CON = 0;&#10;OC2CON = 0;&#10;OC5CON = 0;&#10;OC6CON = 0;' language='C' />
						<command class_type='decision' title='Decision' exp='.Left = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='Left = 0' />
								</command>
								<command class_type='output' title='Apply Left Brake' disable='1' mode='2' port='1048579' mask='3' exp='0x03' usechipref='1' />
								<command class_type='output' title='Release Left Brake' mode='2' port='1048579' mask='3' exp='0' usechipref='1' />
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Mask = .Mask | 1' />
								</command>
								<command class_type='decision' title='Decision' exp='.Left &gt;= 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Left = .Left' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='LeftDir = 0' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Left = 0 - .Left' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='LeftDir = 1' />
										</command>
									</flowline>
								</command>
								<command class_type='output' title='Release Left Brake' mode='2' port='1048579' mask='3' exp='0' usechipref='1' />
							</flowline>
						</command>
						<command class_type='decision' title='Decision' exp='.Right = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='Right = 0' />
								</command>
								<command class_type='output' title='Apply Right Brake' disable='1' mode='2' port='1048579' mask='12' exp='0x0C' usechipref='1' />
								<command class_type='output' title='Release Right Brake' mode='2' port='1048579' mask='12' exp='0' usechipref='1' />
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Mask = .Mask | 2' />
								</command>
								<command class_type='decision' title='Decision' exp='.Right &gt;= 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Right = .Right' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='RightDir = 0' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Right = 0 - .Right' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='RightDir = 1' />
										</command>
									</flowline>
								</command>
								<command class_type='output' title='Release Right Brake' mode='2' port='1048579' mask='12' exp='0' usechipref='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LCDSetBackgroundColour' description='Sets the pixel colour to drive the LCD.&#13;&#10;Default colour is 1 where a set pixel is black and the background is white.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Colour' type='u8' description='Range 0-1 : 0=White, 1=Black' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Component Macro' component='Display' macro='SetBackgroundColour' >
							<argument exp='.Colour' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadLDR_Sim' description='Reads the current light level from the on board light sensor.&#13;&#10;Return value range: 0 to 4095&#13;&#10;4095 represents the maximum level of light and 0 represents the minimal level of light.' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Distance' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='WorldHandle' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' exp='LightSource &gt; 0' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Panel.Position.Math.GetDistance' >
									<return exp='.Distance' />
									<argument exp='LIGHTOBJ' />
									<argument exp='LightSource' />
									<argument exp='.WorldHandle' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Distance = (.Distance / 10.0)' />
								</command>
								<command class_type='decision' title='Decision' exp='.Distance &gt; 4095.0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Return = 4095' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Return = float2int (.Distance)' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Return = 4095 - .Return' />
						</command>
						<command class_type='sim' title='Simulation' macro='Console.SetLineText' >
							<argument exp='ConsoleHandle' />
							<argument exp='19' />
							<argument exp='&quot;Light - &quot; + STRING .Return' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Stop_Sim' description='Stops both motors.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Macro' macro='SetMotors_Sim' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LogoForwardsSim' description='Drives the robot forward using the encoders as feedback to ensure&#13;&#10;the robot drives straight. Automatically stops at the specified distance.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Distance' type='u16' description='Distance you want to robot to drive in mm. Range 1-65535' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='InitialPosition' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='TCalc' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Time' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='SetMotors_Sim' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.TCalc = 5.55 * FLOAT .Distance' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Time = .TCalc' />
						</command>
						<command class_type='decision' title='Decision' exp='AddonMech' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
									<return exp='.InitialPosition' />
									<argument exp='AddonMech' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.MoveAlong' >
									<argument exp='.InitialPosition' />
									<argument exp='.InitialPosition' />
									<argument exp='- .Distance' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.Animate' >
									<argument exp='AddonMech' />
									<argument exp='AddonMech' />
									<argument exp='.InitialPosition' />
									<argument exp='.Time' />
								</command>
							</flowline>
							<flowline >
								<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
									<return exp='.InitialPosition' />
									<argument exp='this' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.MoveAlong' >
									<argument exp='.InitialPosition' />
									<argument exp='.InitialPosition' />
									<argument exp='- .Distance' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.Animate' >
									<argument exp='this' />
									<argument exp='this' />
									<argument exp='.InitialPosition' />
									<argument exp='.Time' />
								</command>
							</flowline>
						</command>
						<command class_type='delay' title='Delay while logo movement completes' exp='.Time' type='1' />
						<command class_type='sim' title='Simulation' macro='Panel.Position.StopAnimate' />
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadIRSensor' description='Reads the analogue value from the specified IR distance sensor.&#13;&#10;Return value range: 0 to 4095&#13;&#10;4095 represents the object is very close.' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Channel' type='u8' description='Range: 0 to 7 - 0=Left, 1=Front Left, 2=Front, 3=Front Right, 4=Right, 5=Rear Right, 6=Rear, 7=Rear Left' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='SampleOn' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='SampleOff' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='.Channel' >
							<case >
								<flowline >
									<command class_type='call' title='Call Component Macro' component='IR0' macro='GetInt' >
										<return exp='.SampleOff' />
									</command>
									<command class_type='output' title='IR Output On' mode='1' port='135266307' mask='1' exp='1' usechipref='1' />
									<command class_type='call' title='Call Component Macro' component='IR0' macro='GetInt' >
										<return exp='.SampleOn' />
									</command>
									<command class_type='output' title='IR Off' mode='1' port='135266307' mask='1' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='call' title='Call Component Macro' component='IR1' macro='GetInt' >
										<return exp='.SampleOff' />
									</command>
									<command class_type='output' title='IR Output On' mode='1' port='135266307' mask='8' exp='1' usechipref='1' />
									<command class_type='call' title='Call Component Macro' component='IR1' macro='GetInt' >
										<return exp='.SampleOn' />
									</command>
									<command class_type='output' title='IR Off' mode='1' port='135266307' mask='8' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='call' title='Call Component Macro' component='IR2' macro='GetInt' >
										<return exp='.SampleOff' />
									</command>
									<command class_type='output' title='IR Output On' mode='1' port='135266307' mask='16' exp='1' usechipref='1' />
									<command class_type='call' title='Call Component Macro' component='IR2' macro='GetInt' >
										<return exp='.SampleOn' />
									</command>
									<command class_type='output' title='IR Off' mode='1' port='135266307' mask='16' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='3' >
								<flowline >
									<command class_type='call' title='Call Component Macro' component='IR3' macro='GetInt' >
										<return exp='.SampleOff' />
									</command>
									<command class_type='output' title='IR Output On' mode='1' port='135266307' mask='32' exp='1' usechipref='1' />
									<command class_type='call' title='Call Component Macro' component='IR3' macro='GetInt' >
										<return exp='.SampleOn' />
									</command>
									<command class_type='output' title='IR Off' mode='1' port='135266307' mask='32' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='4' >
								<flowline >
									<command class_type='call' title='Call Component Macro' component='IR4' macro='GetInt' >
										<return exp='.SampleOff' />
									</command>
									<command class_type='output' title='IR Output On' mode='1' port='135266307' mask='64' exp='1' usechipref='1' />
									<command class_type='call' title='Call Component Macro' component='IR4' macro='GetInt' >
										<return exp='.SampleOn' />
									</command>
									<command class_type='output' title='IR Off' mode='1' port='135266307' mask='64' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='5' >
								<flowline >
									<command class_type='call' title='Call Component Macro' component='IR5' macro='GetInt' >
										<return exp='.SampleOff' />
									</command>
									<command class_type='output' title='IR Output On' mode='1' port='1048576' mask='32' exp='1' usechipref='1' />
									<command class_type='call' title='Call Component Macro' component='IR5' macro='GetInt' >
										<return exp='.SampleOn' />
									</command>
									<command class_type='output' title='IR Off' mode='1' port='1048576' mask='32' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='6' >
								<flowline >
									<command class_type='call' title='Call Component Macro' component='IR6' macro='GetInt' >
										<return exp='.SampleOff' />
									</command>
									<command class_type='output' title='IR Output On' mode='1' port='1048576' mask='64' exp='1' usechipref='1' />
									<command class_type='call' title='Call Component Macro' component='IR6' macro='GetInt' >
										<return exp='.SampleOn' />
									</command>
									<command class_type='output' title='IR Off' mode='1' port='1048576' mask='64' exp='0' usechipref='1' />
								</flowline>
							</case>
							<case exp='7' >
								<flowline >
									<command class_type='call' title='Call Component Macro' component='IR7' macro='GetInt' >
										<return exp='.SampleOff' />
									</command>
									<command class_type='output' title='IR Output On' mode='1' port='1048578' mask='16' exp='1' usechipref='1' />
									<command class_type='call' title='Call Component Macro' component='IR7' macro='GetInt' >
										<return exp='.SampleOn' />
									</command>
									<command class_type='output' title='IR Off' mode='1' port='1048578' mask='16' exp='0' usechipref='1' />
								</flowline>
							</case>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.SampleOn = 4095 - .SampleOn' />
							<exp exp='.SampleOff = 4095 - .SampleOff' />
						</command>
						<command class_type='decision' title='Decision' exp='.SampleOn &gt; .SampleOff' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = .SampleOn - .SampleOff' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SetMotors' description='Sets the speed and direction of the Formula Allcode motors. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Left' type='s16' description='Valid Range = -100 to 100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Right' type='s16' description='Valid Range = -100 to 100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Mask' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='decision' title='Decision' exp='(.Left == 0) &amp;&amp; (.Right == 0)' swap='0' >
							<flowline >
								<command class_type='native' title='Disable All motor PWM' ccode='OC1CON = 0;&#10;OC2CON = 0;&#10;OC5CON = 0;&#10;OC6CON = 0;' language='C' />
								<command class_type='output' title='Apply Both Brakes' mode='2' port='1048579' mask='15' exp='0x0F' usechipref='1' />
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' exp='.Left = 0' swap='0' >
									<flowline >
										<command class_type='native' title='Disable All motor PWM' ccode='OC1CON = 0;&#10;OC5CON = 0;' language='C' />
										<command class_type='calculation' title='Calculation' >
											<exp exp='Left = 0' />
										</command>
										<command class_type='output' title='Apply Left Brake' mode='2' port='1048579' mask='3' exp='0x03' usechipref='1' />
										<command class_type='output' title='Release Left Brake' disable='1' mode='2' port='1048579' mask='3' exp='0' usechipref='1' />
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Mask = .Mask | 1' />
										</command>
										<command class_type='decision' title='Decision' exp='.Left &gt;= 0' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='Left = .Left' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='LeftDir = 0' />
												</command>
												<command class_type='native' title='Disable All motor PWM' ccode='OC5CON = 0;' language='C' />
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='Left = 0 - .Left' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='LeftDir = 1' />
												</command>
												<command class_type='native' title='Disable All motor PWM' ccode='OC1CON = 0;' language='C' />
											</flowline>
										</command>
										<command class_type='output' title='Release Left Brake' mode='2' port='1048579' mask='3' exp='0' usechipref='1' />
									</flowline>
								</command>
								<command class_type='decision' title='Decision' exp='.Right = 0' swap='0' >
									<flowline >
										<command class_type='native' title='Disable All motor PWM' ccode='OC2CON = 0;&#10;OC6CON = 0;' language='C' />
										<command class_type='calculation' title='Calculation' >
											<exp exp='Right = 0' />
										</command>
										<command class_type='output' title='Apply Right Brake' mode='2' port='1048579' mask='12' exp='0x0C' usechipref='1' />
										<command class_type='output' title='Release Right Brake' disable='1' mode='2' port='1048579' mask='12' exp='0' usechipref='1' />
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Mask = .Mask | 2' />
										</command>
										<command class_type='decision' title='Decision' exp='.Right &gt;= 0' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='Right = .Right' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='RightDir = 0' />
												</command>
												<command class_type='native' title='Disable All motor PWM' ccode='OC6CON = 0;' language='C' />
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='Right = 0 - .Right' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='RightDir = 1' />
												</command>
												<command class_type='native' title='Disable All motor PWM' ccode='OC2CON = 0;' language='C' />
											</flowline>
										</command>
										<command class_type='output' title='Release Right Brake' mode='2' port='1048579' mask='12' exp='0' usechipref='1' />
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' exp='MotFeedback = 1' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' exp='LogoMove = 0' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' exp='.Mask = 0' swap='0' >
											<flowline >
												<command class_type='native' title='C Code' ccode='// Motor Encoder Monitor Interrupt Disable&#10;// Interrupt: Disable TMR8&#10;IEC3bits.T8IE = 0;&#10;T8CON = 0;' language='C' />
											</flowline>
											<flowline >
												<command class_type='calculation' title='Reset Encoder Counters' >
													<exp exp='EncCount[0] = 0' />
													<exp exp='EncCount[1] = 0' />
												</command>
												<command class_type='native' title='C Code' ccode='// Motor Encoder Monitor Interrupt Enable&#10;// Interrupt: Enable TMR9 @ 133.514Hz&#10;T8CON = ((T8CON &amp; 0xfffd) | 0x8000);&#10;T8CON = ((T8CON &amp; 0xff0f) | 0x0010);&#10;PR8=65536-1;&#10;IEC3bits.T8IE = 1;' language='C' />
											</flowline>
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LogoBackwards' description='Drives the robot backward using the encoders as feedback to ensure&#13;&#10;the robot drives straight. Automatically stops at the specified distance.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Distance' type='u16' description='Distance you want to robot to drive in mm. Range 1-65535' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='EncTarget' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='FCalc' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.FCalc = int2float (.Distance)' />
							<exp exp='.FCalc = .FCalc / FLOAT EncoderResolution' />
							<exp exp='.EncTarget = float2int (.FCalc)' />
						</command>
						<command class_type='call' title='Call Macro' macro='LogoProcess' >
							<argument exp='-LogoSpeed' />
							<argument exp='-LogoSpeed' />
							<argument exp='.EncTarget' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='BluetoothCheckRx' description='Checks for a string in the Bluetooth receive queue.&#13;&#10;Returns 0 if the string wasn&apos;t found and 1 if the string was found.' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='StrData' type='T8*' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='Len' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Len = Length$ (.StrData)' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='GetEEFloat' description='' statediag='0' >
						<return name='Return' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<param name='Address' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='TStr' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='10' />
						</local>
						<local name='Idx' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Idx = 0' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.Idx &lt; 10' for1='' for3='' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Idx = .Idx + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Return = StringToFloat$ (.TStr)' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='EncoderReset' description='Resets the encoder counters to 0' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='EncCount[0] = 0' />
							<exp exp='EncCount[1] = 0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Reverse' description='Drives both motors of the formula flowcode backwards with the power specified. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Power' type='u8' description='Amount of power to use to drive motor. Range 0-100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Check the power is in range' exp='.Power &gt; 100' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set the power' >
									<exp exp='.Power = 100' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='call' title='Call Macro' macro='SetMotors' >
							<argument exp='-.Power' />
							<argument exp='-.Power' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='WaitForSwitch' description='Waits for the specified switch to be pressed.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Switch' type='u8' description='Which switch do we want to wait for 0=Left, 1=Right, 2=Either, 3=Both' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='done' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='temp' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='loop' title='Loop' type='0' exp='.done = 0' for1='' for3='' >
							<flowline >
								<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='.Switch' >
									<case >
										<flowline >
											<command class_type='input' title='Input' mode='1' port='1048576' mask='1' exp='.done' usechipref='1' />
										</flowline>
									</case>
									<case exp='1' >
										<flowline >
											<command class_type='input' title='Input' mode='1' port='1048576' mask='2' exp='.done' usechipref='1' />
										</flowline>
									</case>
									<case exp='2' >
										<flowline >
											<command class_type='input' title='Input' mode='2' port='1048576' mask='3' exp='.done' usechipref='1' />
										</flowline>
									</case>
									<case exp='3' >
										<flowline >
											<command class_type='input' title='Input' mode='2' port='1048576' mask='3' exp='.temp' usechipref='1' />
											<command class_type='decision' title='Decision' exp='.temp = 3' swap='0' >
												<flowline >
													<command class_type='calculation' title='Calculation' >
														<exp exp='.done = 1' />
													</command>
												</flowline>
												<flowline />
											</command>
										</flowline>
									</case>
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadLDR' description='Reads the current light level from the on board light sensor.&#13;&#10;Return value range: 0 to 4095&#13;&#10;4095 represents the maximum level of light and 0 represents the minimal level of light.' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Read Light Sensor' component='LDR' macro='GetInt' >
							<return exp='.Return' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LCDDrawRectangle' description='Draws a rectange on the LCD.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='X1' type='u8' description='Range 0-127' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Y1' type='u8' description='Range 0-31' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='X2' type='u8' description='Range 0-127' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Y2' type='u8' description='Range 0-31' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Transparent' type='u8' description='Sets the transparency of the box, 0=Box contains background colour, 1=Box contains previous pixel data' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Solid' type='u8' description='Chooses to fill the box with colour, 0=Box contains transparency data, 1=Box contains foreground colour' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Component Macro' component='Display' macro='DrawRectangle' >
							<argument exp='.X1' />
							<argument exp='.Y1' />
							<argument exp='.X2' />
							<argument exp='.Y2' />
							<argument exp='.Transparent' />
							<argument exp='.Solid' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LogoTurnLeftSim' description='Rotates the robot left by a specific angle using the encoders as feedback to ensure&#13;&#10;the robot turns evenly. Automatically stops at the specified turn angle.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Angle' type='u16' description='Angle in degrees you wish to rotate. Range 1-65536' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='InitialPosition' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Time' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='TCalc' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='call' title='Call Macro' macro='SetMotors_Sim' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.TCalc = 5.55 * FLOAT .Angle' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Time = .TCalc' />
						</command>
						<command class_type='decision' title='Decision' exp='AddonMech' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
									<return exp='.InitialPosition' />
									<argument exp='AddonMech' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.RotateZ' >
									<argument exp='.InitialPosition' />
									<argument exp='.InitialPosition' />
									<argument exp='.Angle' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.Animate' >
									<argument exp='AddonMech' />
									<argument exp='AddonMech' />
									<argument exp='.InitialPosition' />
									<argument exp='.Time' />
								</command>
							</flowline>
							<flowline >
								<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
									<return exp='.InitialPosition' />
									<argument exp='this' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.RotateZ' >
									<argument exp='.InitialPosition' />
									<argument exp='.InitialPosition' />
									<argument exp='.Angle' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.Animate' >
									<argument exp='this' />
									<argument exp='this' />
									<argument exp='.InitialPosition' />
									<argument exp='.Time' />
								</command>
							</flowline>
						</command>
						<command class_type='delay' title='Delay while logo movement completes' exp='.Time' type='1' />
						<command class_type='sim' title='Simulation' macro='Panel.Position.StopAnimate' />
					</flowline>
				</macro>
				<macro >
					<flowline name='LogoBackwardsSim' description='Drives the robot forward using the encoders as feedback to ensure&#13;&#10;the robot drives straight. Automatically stops at the specified distance.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Distance' type='u16' description='Distance you want to robot to drive in mm. Range 1-65535' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='InitialPosition' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='TCalc' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Time' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='SetMotors_Sim' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.TCalc = 5.55 * FLOAT .Distance' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Time = .TCalc' />
						</command>
						<command class_type='decision' title='Decision' exp='AddonMech' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
									<return exp='.InitialPosition' />
									<argument exp='AddonMech' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.MoveAlong' >
									<argument exp='.InitialPosition' />
									<argument exp='.InitialPosition' />
									<argument exp='.Distance' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.Animate' >
									<argument exp='AddonMech' />
									<argument exp='AddonMech' />
									<argument exp='.InitialPosition' />
									<argument exp='.Time' />
								</command>
							</flowline>
							<flowline >
								<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
									<return exp='.InitialPosition' />
									<argument exp='this' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.MoveAlong' >
									<argument exp='.InitialPosition' />
									<argument exp='.InitialPosition' />
									<argument exp='.Distance' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.Animate' >
									<argument exp='this' />
									<argument exp='this' />
									<argument exp='.InitialPosition' />
									<argument exp='.Time' />
								</command>
							</flowline>
						</command>
						<command class_type='delay' title='Delay while logo movement completes' exp='.Time' type='1' />
						<command class_type='sim' title='Simulation' macro='Panel.Position.StopAnimate' />
					</flowline>
				</macro>
				<macro >
					<flowline name='EncoderReadCount' description='Reads one of the motor encoder counters.&#13;&#10;Each encoder count is equal to 0.314159 mm.&#13;&#10;' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Channel' type='u8' description='0 = LeftCount, 1=RightCount' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' exp='.Channel &gt; 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = EncCount[1]' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = EncCount[0]' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Start' description='Broadcast to all components that simulation is starting' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='SimStop = 0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LogoTurnRightSim' description='Rotates the robot right by a specific angle using the encoders as feedback to ensure the robot turns evenly. Automatically stops at the specified turn angle.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Angle' type='u16' description='Angle in degrees you wish to rotate. Range 1-65536' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='InitialPosition' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Time' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='TCalc' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='call' title='Call Macro' macro='SetMotors_Sim' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.TCalc = 5.55 * FLOAT .Angle' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Time = .TCalc' />
						</command>
						<command class_type='decision' title='Decision' exp='AddonMech' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
									<return exp='.InitialPosition' />
									<argument exp='AddonMech' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.RotateZ' >
									<argument exp='.InitialPosition' />
									<argument exp='.InitialPosition' />
									<argument exp='-.Angle' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.Animate' >
									<argument exp='AddonMech' />
									<argument exp='AddonMech' />
									<argument exp='.InitialPosition' />
									<argument exp='.Time' />
								</command>
							</flowline>
							<flowline >
								<command class_type='sim' title='Simulation' macro='Panel.Position.Get' >
									<return exp='.InitialPosition' />
									<argument exp='this' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.RotateZ' >
									<argument exp='.InitialPosition' />
									<argument exp='.InitialPosition' />
									<argument exp='-.Angle' />
								</command>
								<command class_type='sim' title='Simulation' macro='Panel.Position.Animate' >
									<argument exp='this' />
									<argument exp='this' />
									<argument exp='.InitialPosition' />
									<argument exp='.Time' />
								</command>
							</flowline>
						</command>
						<command class_type='delay' title='Delay while logo movement completes' exp='.Time' type='1' />
						<command class_type='sim' title='Simulation' macro='Panel.Position.StopAnimate' />
					</flowline>
				</macro>
				<macro >
					<flowline name='SetEEFloat' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Address' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Value' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='TStr' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='10' />
						</local>
						<local name='Idx' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.TStr = FloatToString$ (.Value)' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Idx = 0' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.Idx &lt; 10' for1='' for3='' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Idx = .Idx + 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='CheckUSB' description='Checks to see if a USB cable is connected to the robot.&#13;&#10;Returns 0 for no connection and 1 for an active connection.' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
					</flowline>
				</macro>
				<macro keep='1' >
					<flowline name='Interrupt_BluetoothRX' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='in' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='void _ISR _U1RXInterrupt(void)&#10;{&#10;    char FCL_IN;' language='C' />
						<command class_type='native' title='Simplify the receive function for fixed HW' disable='1' ccode='FCL_IN = U1RXREG &amp; 0xFF;' language='C' />
						<command class_type='decision' title='Decision' exp='CmdActive = 1' swap='0' >
							<flowline >
								<command class_type='decision' title='Check for &apos;?&apos;' exp='.in = 63' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' exp='BlueReset = 1' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='ResetCount = ResetCount + 1' />
												</command>
												<command class_type='decision' title='Decision' exp='ResetCount = 3' swap='0' >
													<flowline >
														<command class_type='native' title='Bootloader Reset Trigger' ccode='asm(&quot;RESET&quot;);' language='C' />
													</flowline>
													<flowline />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='ResetCount = 0' />
										</command>
										<command class_type='decision' title='Check for &apos;:&apos;' exp='.in = 58' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='AreYouThereCount = AreYouThereCount + 1' />
												</command>
												<command class_type='decision' title='Decision' exp='AreYouThereCount = 3' swap='0' >
													<flowline >
														<command class_type='calculation' title='Calculation' >
															<exp exp='AreYouThereCount = 0' />
														</command>
														<command class_type='call' title='Call Macro' macro='BluetoothTransmit' >
															<argument exp='1' />
														</command>
														<command class_type='call' title='Call Macro' macro='BluetoothTransmit' >
															<argument exp='6' />
														</command>
														<command class_type='call' title='Call Macro' macro='BluetoothTransmitString' >
															<argument exp='&quot;FA Connected&quot;' />
														</command>
														<command class_type='call' title='Call Macro' macro='BluetoothTransmit' >
															<argument exp='0' />
														</command>
														<command class_type='call' title='Call Macro' macro='BluetoothTransmit' >
															<argument exp='0xEA' />
														</command>
														<command class_type='call' title='Call Macro' macro='BluetoothTransmit' >
															<argument exp='0x4F' />
														</command>
														<command class_type='call' title='Call Macro' macro='BluetoothTransmit' >
															<argument exp='4' />
														</command>
														<command class_type='calculation' title='Calculation' >
															<exp exp='CmdActive = 0' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='AreYouThereCount = 0' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='CmdActive = 0' />
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' exp='.in = 27' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='ResetCount = 0' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='AreYouThereCount = 0' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='CmdActive = 1' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
						<command class_type='native' title='C Code' ccode='IFS0bits.U1RXIF = 0;&#10;}' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='SpinRight_Sim' description='Spins the formula flowcode on the spot in a clockwise direction as seen from above. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Power' type='u8' description='Amount of power to use to drive motor. Range 0-100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='SetMotors_Sim' >
							<argument exp='.Power' />
							<argument exp='- .Power' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Resume' description='Broadcast to all components that simulation has resumed' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='SimStop = 0' />
						</command>
						<command class_type='sim' title='Simulation' macro='System.TimerStart' >
							<argument exp='0' />
							<argument exp='timer_interval' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LCDSetForegroundColour' description='Sets the pixel colour to drive the LCD.&#13;&#10;Default colour is 1 where a set pixel is black and the background is white.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Colour' type='u8' description='Range 0-1 : 0=White, 1=Black' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Component Macro' component='Display' macro='SetForegroundColour' >
							<argument exp='.Colour' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialise' description='Starts up the Formula Allcode PWM for motor control and performs the wait for button press if enabled.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='sw' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='Cmd' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='Test' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Sw = 0' />
							<exp exp='.Cmd = &quot;&quot;' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='ResetCount = 0' />
							<exp exp='AreYouThereCount = 0' />
							<exp exp='CmdActive = 0' />
						</command>
						<command class_type='delay' title='Wait for PLL to lock' exp='10' type='1' />
						<command class_type='comment' title='' comment='Initialise Motors' textarea='12,0,12,0' />
						<command class_type='output' title='Init Motor Dir Pins' mode='2' port='1048579' mask='15' exp='0x00' usechipref='1' />
						<command class_type='output' title='Enable Motor Driver' mode='1' port='1048582' mask='128' exp='1' usechipref='1' />
						<command class_type='sim' title='Simulation' macro='Connection.SetAn' >
							<argument exp='21' />
							<argument exp='0.606' />
							<argument exp='0' />
						</command>
						<command class_type='comment' title='' comment='Initialise LCD&#10;' textarea='12,0,12,0' />
						<command class_type='decision' title='Decision' exp='(CreationInfo = 2) | (CreationInfo = 3)' swap='0' >
							<flowline />
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='(CreationInfo = 1) | (CreationInfo = 3)' swap='0' >
							<flowline />
							<flowline />
						</command>
						<command class_type='call' title='Call Macro' disable='1' macro='BattMon' />
						<command class_type='comment' title='' comment='Initialise backlight' textarea='12,0,12,0' />
						<command class_type='call' title='Call Macro' macro='LCDBacklight' >
							<argument exp='50' />
						</command>
						<command class_type='comment' title='' comment='Enable Interrupts' textarea='12,0,12,0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='EncSave = $PORTB &gt;&gt; 11' />
						</command>
						<command class_type='native' title='C Code' ccode='// Bluetooth RX Interrupt Enable&#10;// Interrupt: Enable RXINT0&#10;IEC0bits.U1RXIE = 1;&#10;&#10;// Encoder Interrupt Enable&#10;// Interrupt: Enable IOC0&#10;CNENA = 0x0;&#10;CNENB = 0x1800;&#10;CNENC = 0x0;&#10;CNEND = 0x0;&#10;CNENE = 0x0;&#10;CNENF = 0x0;&#10;CNENG = 0x0;&#10;IEC1bits.CNIE = 1;' language='C' />
						<command class_type='comment' title='' comment='Restore Logo Resultion From Flash EE memory' textarea='12,0,12,0' />
						<command class_type='decision' title='Decision' exp='.Test = 0' swap='0' >
							<flowline >
								<command class_type='call' title='Load new default Distance' macro='GetEEFloat' >
									<return exp='EncoderResolution' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Load new default angle' macro='GetEEFloat' >
									<return exp='AngleResolution' />
									<argument exp='10' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='comment' title='' comment='Wait for switch' textarea='12,0,12,0' />
						<command class_type='decision' title='Wait for switch press?' exp='wait_b4_start = 1' swap='0' >
							<flowline >
								<command class_type='loop' title='Loop' type='0' exp='.sw = 0' for1='' for3='' >
									<flowline >
										<command class_type='call' title='Call Macro' disable='1' macro='BattMon' />
										<command class_type='input' title='Input' mode='2' port='1048576' mask='3' exp='.sw' usechipref='1' />
										<command class_type='delay' title='Delay' exp='20' type='1' />
									</flowline>
								</command>
								<command class_type='delay' title='Delay' exp='50' type='1' />
								<command class_type='loop' title='Loop' type='0' exp='.sw &gt; 0' for1='' for3='' >
									<flowline >
										<command class_type='input' title='Input' mode='2' port='1048576' mask='3' exp='.sw' usechipref='1' />
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='delay' title='Delay' exp='startup_time' type='1' />
							</flowline>
						</command>
						<command class_type='call' title='Call Macro' macro='LCDBacklight' >
							<argument exp='0' />
						</command>
						<command class_type='decision' title='Decision' exp='0' swap='0' >
							<flowline >
								<command class_type='call' title='Call Macro' macro='SetMotorsInterrupt' >
									<argument exp='0' />
									<argument exp='0' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadBattery_Sim' description='Reads the current voltage level from the LiPo battery.&#13;&#10;Return value is the battery voltage in Volts.&#13;&#10;Take care not to run the battery too low. &#13;&#10;Voltages lower than 3.4V may damage the battery.' statediag='0' >
						<return name='Return' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Return = 4.0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SetMotors_Sim' description='Sets the speed and direction of the Formula Allcode motors. ' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Left' type='s16' description='Valid Range = -100 to 100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Right' type='s16' description='Valid Range = -100 to 100' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Dir_L' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Dir_R' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Pwr_L' type='s16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Pwr_R' type='s16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='temp' type='s32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='sim' title='Simulation' macro='Console.SetLineText' >
							<argument exp='ConsoleHandle' />
							<argument exp='15' />
							<argument exp='&quot;L - &quot; + STRING .Left' />
						</command>
						<command class_type='sim' title='Simulation' macro='Console.SetLineText' >
							<argument exp='ConsoleHandle' />
							<argument exp='16' />
							<argument exp='&quot;R - &quot; + STRING .Right' />
						</command>
						<command class_type='sim' title='Simulation' macro='System.TimerStop' >
							<argument exp='0' />
						</command>
						<command class_type='decision' title='Decision' exp='.Left &lt; 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='1 = Backwards' >
									<exp exp='.Dir_L = 1' />
									<exp exp='.Pwr_L = 0 - .Left' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='0 = Forwards' >
									<exp exp='.Dir_L = 0' />
									<exp exp='.Pwr_L = .Left' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' exp='.Right &lt; 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='1 = Backwards' >
									<exp exp='.Dir_R = 1' />
									<exp exp='.Pwr_R = 0 - .Right' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='0 = Forwards' >
									<exp exp='.Dir_R = 0' />
									<exp exp='.Pwr_R = .Right' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Are the motors at the same rate' exp='.Pwr_L = .Pwr_R' swap='0' >
							<flowline >
								<command class_type='decision' title='Both motors off?' exp='.Left = 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='tmr_running = 0' />
											<exp exp='Movement = 0' />
											<exp exp='Rotation = 0' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Both motors going the same way?' exp='.Dir_L = .Dir_R' swap='0' >
											<flowline >
												<command class_type='calculation' title='Purely Movement' >
													<exp exp='Rotation = 0' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='Movement = .Left' />
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Purely Rotation' >
													<exp exp='Movement = 0' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='Rotation = - .Left' />
												</command>
											</flowline>
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='tmr_running = 1' />
										</command>
										<command class_type='call' title='Call Macro' macro='Ev_Timer' >
											<argument exp='0' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Both motors going the same way?' exp='.Dir_L = .Dir_R' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' exp='.Dir_L' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='Movement = (.Left + .Right) / 2' />
												</command>
												<command class_type='calculation' title='Calculate Rotation' >
													<exp exp='Rotation = .Left - .Right' />
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='Movement = (.Left + .Right) / 2' />
												</command>
												<command class_type='calculation' title='Calculate Rotation' >
													<exp exp='Rotation = .Right - .Left' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Decision' exp='.Dir_L' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculate Movement' >
													<exp exp='Movement = .Left - .Right' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='Rotation = (.Left + .Right) / 2' />
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculate Movement' >
													<exp exp='Movement = .Right - .Left' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='Rotation = (.Left + .Right) / 2' />
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='tmr_running = 1' />
								</command>
								<command class_type='call' title='Call Macro' macro='Ev_Timer' >
									<argument exp='0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LogoSetSpeed' description='Sets the cruise speed for LOGO type macros.&#13;&#10;Default speed 20%.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Speed' type='u8' description='Range 1-100, Default 60' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Check the power is in range' exp='.Speed &gt; 100' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set the power' >
									<exp exp='.Speed = 100' />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Check the power is in range' exp='.Speed &lt; 1' swap='0' >
									<flowline >
										<command class_type='calculation' title='Set the power' >
											<exp exp='.Speed = 1' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='LogoSpeed = .Speed' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LogoForwards' description='Drives the robot forward using the encoders as feedback to ensure&#13;&#10;the robot drives straight. Automatically stops at the specified distance.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Distance' type='u16' description='Distance you want to robot to drive in mm. Range 1-65535' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='EncTarget' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='FCalc' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.FCalc = int2float (.Distance)' />
							<exp exp='.FCalc = .FCalc / FLOAT EncoderResolution' />
							<exp exp='.EncTarget = float2int (.FCalc)' />
						</command>
						<command class_type='call' title='Call Macro' macro='LogoProcess' >
							<argument exp='LogoSpeed' />
							<argument exp='LogoSpeed' />
							<argument exp='.EncTarget' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LCDClear' description='Clears the contents of the graphical LCD.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Component Macro' component='Display' macro='ClearDisplay' />
					</flowline>
				</macro>
			</macros>
			<component class_type='shape' codename='WheelL' panelId='-1' x='0' y='-42' z='-11' xsz='30' ysz='14' zsz='30' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:Wheel.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='WheelR' panelId='-1' x='0' y='42' z='-11' xsz='30' ysz='13.2' zsz='30' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:Wheel2.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='IROBJ6' panelId='-1' x='46' y='-7' z='-13' xsz='6' ysz='4.5' zsz='6' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:IR.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='IROBJ2' panelId='-1' x='-46' y='7' z='-13' xsz='6' ysz='4.5' zsz='6' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:IR.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='IROBJ5' panelId='-1' x='43' y='33' z='-13' xsz='6' ysz='4.5' zsz='6' xang='0' yang='0' zang='44.9999' xquat='0' yquat='0' zquat='0.382683' wquat='0.92388' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:IR.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='IROBJ7' panelId='-1' x='43' y='-33' z='-13' xsz='6' ysz='4.5' zsz='6' xang='0' yang='0' zang='-44.9999' xquat='0' yquat='0' zquat='-0.382683' wquat='0.92388' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:IR.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='IROBJ3' panelId='-1' x='-43' y='33' z='-13' xsz='6' ysz='4.5' zsz='6' xang='0' yang='0' zang='135' xquat='0' yquat='0' zquat='0.92388' wquat='0.382683' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:IR.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='IROBJ1' panelId='-1' x='-43' y='-33' z='-13' xsz='6' ysz='4.5' zsz='6' xang='0' yang='0' zang='-135' xquat='0' yquat='0' zquat='-0.92388' wquat='0.382683' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:IR.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='IROBJ4' panelId='-1' x='-24' y='36.5' z='-13' xsz='6' ysz='4.5' zsz='6' xang='0' yang='0' zang='90' xquat='0' yquat='0' zquat='0.707107' wquat='0.707107' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:IR.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='IROBJ0' panelId='-1' x='-24' y='-36.5' z='-13' xsz='6' ysz='4.5' zsz='6' xang='0' yang='0' zang='-90' xquat='0' yquat='0' zquat='-0.707107' wquat='0.707107' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:IR.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='LIGHTOBJ' panelId='-1' x='-46' y='-7' z='-13' xsz='6' ysz='7' zsz='6' xang='0' yang='0' zang='-90' xquat='0' yquat='0' zquat='-0.707107' wquat='0.707107' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='14803425' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:FF_001_LED.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='LFR1' panelId='-1' x='-25' y='8.5' z='-19.05' xsz='3' ysz='3' zsz='3' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='3947580' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='C:\Dev\Flowcode V6\Components\models\Formula Flowcode 002\FF_001_LEDnolegs.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='LFR0' panelId='-1' x='-28.2' y='8.5' z='-19.05' xsz='3' ysz='3' zsz='3' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='16760832' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='C:\Dev\Flowcode V6\Components\models\Formula Flowcode 002\FF_001_LEDnolegs.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='LFL1' panelId='-1' x='-25' y='-8.5' z='-19.05' xsz='3' ysz='3' zsz='3' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='3947580' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='C:\Dev\Flowcode V6\Components\models\Formula Flowcode 002\FF_001_LEDnolegs.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='LFL0' panelId='-1' x='-28.2' y='-8.5' z='-19.05' xsz='3' ysz='3' zsz='3' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='16760832' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='C:\Dev\Flowcode V6\Components\models\Formula Flowcode 002\FF_001_LEDnolegs.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='shape2' panelId='-1' x='0' y='0' z='0.8' xsz='48' ysz='34' zsz='71' xang='90' yang='0' zang='0' xquat='0.707107' yquat='0' zquat='0' wquat='0.707107' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:Moulding.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='shape' codename='shape1' panelId='-1' x='0' y='0' z='-17.3' xsz='99' ysz='1.6' zsz='80' xang='90' yang='0' zang='0' xquat='0.707107' yquat='0' zquat='0' wquat='0.707107' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='192' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='this:PCB.mesh' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='d45b78bf-398d-4b6c-81f0-8c82f6cec907' vmin='2' vmaj='1' codename='LeftSwitch' panelId='-1' x='-30' y='-20' z='-14' xsz='0.777778' ysz='0.725806' zsz='0.675676' xang='0' yang='0' zang='90' xquat='0' yquat='0' zquat='0.707107' wquat='0.707107' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTA.0' />
					<value target='polarity' data='000' />
					<value target='debounce' data='10' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='d45b78bf-398d-4b6c-81f0-8c82f6cec907' vmin='2' vmaj='1' codename='RightSwitch' panelId='-1' x='-30' y='20' z='-14' xsz='0.777778' ysz='0.725806' zsz='0.675676' xang='0' yang='0' zang='90' xquat='0' yquat='0' zquat='0.707107' wquat='0.707107' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTA.0' />
					<value target='polarity' data='000' />
					<value target='debounce' data='10' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='group' codename='group1' panelId='-1' x='0' y='0' z='0' xsz='0.001' ysz='0.001' zsz='0.001' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values />
				<events />
				<apis />
				<variables />
				<macros />
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='IR0' panelId='-1' x='-7.22232' y='3.29431' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='4' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='35' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='LDR' panelId='-1' x='-7.22232' y='1.08945' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='2' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='40' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='LF1' panelId='-1' x='-3.80178' y='1.20269' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='0' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='4' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='LF2' panelId='-1' x='-1.59692' y='1.20269' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='1' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='4' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='IR1' panelId='-1' x='-5.01745' y='3.29431' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='5' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='35' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='IR2' panelId='-1' x='-2.81257' y='3.29431' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='14' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='35' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='IR3' panelId='-1' x='-0.607708' y='3.29431' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='15' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='35' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='IR4' panelId='-1' x='1.59711' y='3.29431' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='8' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='35' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='IR5' panelId='-1' x='3.79501' y='3.29431' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='9' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='35' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='IR6' panelId='-1' x='5.99991' y='3.29431' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='10' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='35' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='IR7' panelId='-1' x='8.20481' y='3.29431' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='20' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='35' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='MIC' panelId='-1' x='1.59711' y='1.08945' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='3' />
						<value target='vrefvol' data='500' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='2' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='Battery' panelId='-1' x='5.99991' y='1.08945' z='57.7344' xsz='2.76335' ysz='2.76335' zsz='2.02784' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='angle_start' data='225.000000' />
						<value target='angle_sweep' data='270.000000' />
						<value target='cap_color' data='192' />
						<value target='point_color' data='16777215' />
						<value target='ScopeTraces' data='0' />
						<value target='RetainValue' data='0' />
						<value target='SetValue' data='0.574074' />
						<value target='channel' data='21' />
						<value target='vrefvol' data='660' />
						<value target='vrefop' data='000' />
						<value target='adc_base::convspd' data='003' />
						<value target='actime' data='40' />
						<value target='bits' data='12' />
						<value target='bitmul' data='0.004883' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='9d687cd1-0972-49af-b179-46df5fdc55fe' vmin='0' vmaj='1' codename='flasheeprom1' panelId='-1' x='-5.58649' y='-7.05046' z='59.6543' xsz='0.04' ysz='0.04' zsz='1' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='FPSIZE' data='1024' />
						<value target='simfilename' data='test.eep' />
						<value target='NRPAGES' data='2' />
						<value target='AUTOADDR' data='1' />
						<value target='FLASHADDRESS' data='0' />
						<value target='CLEARPAGES' data='4' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='8d619fb4-12ba-4c00-a6a8-32dd5887de72' vmin='3' vmaj='1' codename='PWM_LeftMotorFW1' panelId='-1' x='-7.37915' y='7.7205' z='56.9455' xsz='2' ysz='2' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='CHANNEL' data='001' />
						<value target='HWALT' data='0' />
						<value target='PORT' data='$PORTG.15' />
						<value target='RemapPin' data='000' />
						<value target='REF' data='0' />
						<value target='PERIOD' data='255' />
						<value target='PRESCALE' data='002' />
						<value target='timer' data='2' />
						<value target='CLK_SPEED' data='140000000' />
						<value target='CALC_PERIOD' data='14.628572' />
						<value target='CALC_FREQ' data='68.359375' />
						<value target='PWM_PORT' data='$PORTG.15' />
						<value target='PWM_TRIS' data='$PORTG.15' />
						<value target='PWM_PIN' data='15' />
						<value target='master_divider' data='2' />
						<value target='PWM_PRESCALE' data='4' />
						<value target='Remappable' data='1' />
						<value target='OutputReg' data='000' />
						<value target='OCRPNUM' data='16' />
						<value target='OCBank' data='' />
						<value target='AltReg' data='' />
						<value target='AltMask' data='0' />
						<value target='pwm_type' data='0' />
						<value target='PWMName' data='' />
						<value target='PWMClock' data='' />
						<value target='PWMNumber' data='' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='8d619fb4-12ba-4c00-a6a8-32dd5887de72' vmin='3' vmaj='1' codename='PWM_RightMotorFW1' panelId='-1' x='-4.58649' y='7.7205' z='56.9455' xsz='2' ysz='2' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='CHANNEL' data='001' />
						<value target='HWALT' data='0' />
						<value target='PORT' data='$PORTG.15' />
						<value target='RemapPin' data='000' />
						<value target='REF' data='0' />
						<value target='PERIOD' data='255' />
						<value target='PRESCALE' data='002' />
						<value target='timer' data='2' />
						<value target='CLK_SPEED' data='140000000' />
						<value target='CALC_PERIOD' data='14.628572' />
						<value target='CALC_FREQ' data='68.359375' />
						<value target='PWM_PORT' data='$PORTG.15' />
						<value target='PWM_TRIS' data='$PORTG.15' />
						<value target='PWM_PIN' data='15' />
						<value target='master_divider' data='2' />
						<value target='PWM_PRESCALE' data='4' />
						<value target='Remappable' data='1' />
						<value target='OutputReg' data='000' />
						<value target='OCRPNUM' data='16' />
						<value target='OCBank' data='' />
						<value target='AltReg' data='' />
						<value target='AltMask' data='0' />
						<value target='pwm_type' data='0' />
						<value target='PWMName' data='' />
						<value target='PWMClock' data='' />
						<value target='PWMNumber' data='' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='8d619fb4-12ba-4c00-a6a8-32dd5887de72' vmin='3' vmaj='1' codename='PWM_LeftMotorBW1' panelId='-1' x='-1.58649' y='7.80732' z='56.9455' xsz='2' ysz='2' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='CHANNEL' data='001' />
						<value target='HWALT' data='0' />
						<value target='PORT' data='$PORTG.15' />
						<value target='RemapPin' data='000' />
						<value target='REF' data='0' />
						<value target='PERIOD' data='255' />
						<value target='PRESCALE' data='002' />
						<value target='timer' data='2' />
						<value target='CLK_SPEED' data='140000000' />
						<value target='CALC_PERIOD' data='14.628572' />
						<value target='CALC_FREQ' data='68.359375' />
						<value target='PWM_PORT' data='$PORTG.15' />
						<value target='PWM_TRIS' data='$PORTG.15' />
						<value target='PWM_PIN' data='15' />
						<value target='master_divider' data='2' />
						<value target='PWM_PRESCALE' data='4' />
						<value target='Remappable' data='1' />
						<value target='OutputReg' data='000' />
						<value target='OCRPNUM' data='16' />
						<value target='OCBank' data='' />
						<value target='AltReg' data='' />
						<value target='AltMask' data='0' />
						<value target='pwm_type' data='0' />
						<value target='PWMName' data='' />
						<value target='PWMClock' data='' />
						<value target='PWMNumber' data='' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='8d619fb4-12ba-4c00-a6a8-32dd5887de72' vmin='3' vmaj='1' codename='PWM_RightMotorBW1' panelId='-1' x='1.41351' y='7.8073' z='56.9455' xsz='2' ysz='2' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='CHANNEL' data='001' />
						<value target='HWALT' data='0' />
						<value target='PORT' data='$PORTG.15' />
						<value target='RemapPin' data='000' />
						<value target='REF' data='0' />
						<value target='PERIOD' data='255' />
						<value target='PRESCALE' data='002' />
						<value target='timer' data='2' />
						<value target='CLK_SPEED' data='140000000' />
						<value target='CALC_PERIOD' data='14.628572' />
						<value target='CALC_FREQ' data='68.359375' />
						<value target='PWM_PORT' data='$PORTG.15' />
						<value target='PWM_TRIS' data='$PORTG.15' />
						<value target='PWM_PIN' data='15' />
						<value target='master_divider' data='2' />
						<value target='PWM_PRESCALE' data='4' />
						<value target='Remappable' data='1' />
						<value target='OutputReg' data='000' />
						<value target='OCRPNUM' data='16' />
						<value target='OCBank' data='' />
						<value target='AltReg' data='' />
						<value target='AltMask' data='0' />
						<value target='pwm_type' data='0' />
						<value target='PWMName' data='' />
						<value target='PWMClock' data='' />
						<value target='PWMNumber' data='' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='8d619fb4-12ba-4c00-a6a8-32dd5887de72' vmin='3' vmaj='1' codename='PWM_AudioOut1' panelId='-1' x='4.79201' y='7.94326' z='-56.9455' xsz='2' ysz='2' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='CHANNEL' data='001' />
						<value target='HWALT' data='0' />
						<value target='PORT' data='$PORTG.15' />
						<value target='RemapPin' data='000' />
						<value target='REF' data='0' />
						<value target='PERIOD' data='255' />
						<value target='PRESCALE' data='002' />
						<value target='timer' data='2' />
						<value target='CLK_SPEED' data='140000000' />
						<value target='CALC_PERIOD' data='14.628572' />
						<value target='CALC_FREQ' data='68.359375' />
						<value target='PWM_PORT' data='$PORTG.15' />
						<value target='PWM_TRIS' data='$PORTG.15' />
						<value target='PWM_PIN' data='15' />
						<value target='master_divider' data='2' />
						<value target='PWM_PRESCALE' data='4' />
						<value target='Remappable' data='1' />
						<value target='OutputReg' data='000' />
						<value target='OCRPNUM' data='16' />
						<value target='OCBank' data='' />
						<value target='AltReg' data='' />
						<value target='AltMask' data='0' />
						<value target='pwm_type' data='0' />
						<value target='PWMName' data='' />
						<value target='PWMClock' data='' />
						<value target='PWMNumber' data='' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='8d619fb4-12ba-4c00-a6a8-32dd5887de72' vmin='3' vmaj='1' codename='LCD_Backlight' panelId='-1' x='6.17301' y='-6.53617' z='56.9455' xsz='2' ysz='2' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='CHANNEL' data='001' />
						<value target='HWALT' data='0' />
						<value target='PORT' data='$PORTG.15' />
						<value target='RemapPin' data='000' />
						<value target='REF' data='0' />
						<value target='PERIOD' data='255' />
						<value target='PRESCALE' data='002' />
						<value target='timer' data='2' />
						<value target='CLK_SPEED' data='140000000' />
						<value target='CALC_PERIOD' data='14.628572' />
						<value target='CALC_FREQ' data='68.359375' />
						<value target='PWM_PORT' data='$PORTG.15' />
						<value target='PWM_TRIS' data='$PORTG.15' />
						<value target='PWM_PIN' data='15' />
						<value target='master_divider' data='2' />
						<value target='PWM_PRESCALE' data='4' />
						<value target='Remappable' data='1' />
						<value target='OutputReg' data='000' />
						<value target='OCRPNUM' data='16' />
						<value target='OCBank' data='' />
						<value target='AltReg' data='' />
						<value target='AltMask' data='0' />
						<value target='pwm_type' data='0' />
						<value target='PWMName' data='' />
						<value target='PWMClock' data='' />
						<value target='PWMNumber' data='' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='b8ce2cdc-ed76-4157-8ed8-96b1bb736bd3' vmin='0' vmaj='2' codename='BlueTooth' panelId='-1' x='-2.76362' y='-2.33397' z='56.8282' xsz='6.5946' ysz='2.85766' zsz='0.165964' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='cal_uart::CHANNEL' data='001' />
						<value target='cal_uart::BAUD_LIST' data='004' />
						<value target='cal_uart::BAUD' data='9600' />
						<value target='cal_uart::DBITS' data='008' />
						<value target='cal_uart::RETURN' data='000' />
						<value target='cal_uart::ECHO' data='000' />
						<value target='cal_uart::UseTX' data='1' />
						<value target='cal_uart::TX' data='$PORTD.15' />
						<value target='cal_uart::OutputPins' data='007' />
						<value target='cal_uart::TXAlt' data='0' />
						<value target='cal_uart::UseRX' data='1' />
						<value target='cal_uart::RX' data='' />
						<value target='cal_uart::InputPins' data='013' />
						<value target='cal_uart::RXAlt' data='0' />
						<value target='cal_uart::FLOWEN' data='001' />
						<value target='cal_uart::RTS' data='$PORTB.2' />
						<value target='cal_uart::CTS' data='$PORTB.1' />
						<value target='label' data='UART' />
						<value target='cal_uart::ScopeTraces' data='0' />
						<value target='cal_uart::ConsoleData' data='0' />
						<value target='cal_uart::ConsoleColumns' data='64' />
						<value target='cal_uart::DataSource' data='000' />
						<value target='cal_uart::com_port' data='000' />
						<value target='cal_uart::Injector' data='000' />
						<value target='cal_uart::APIUseDDR' data='' />
						<value target='cal_uart::APIDDRPin' data='' />
						<value target='cal_uart::APIDDRRXState' data='' />
						<value target='cal_uart::APIUseFC' data='' />
						<value target='cal_uart::APICTSPin' data='' />
						<value target='cal_uart::APIRTSPin' data='' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='4b470b69-a5ec-4c2c-9b3e-67c88ba17583' vmin='5' vmaj='1' codename='CB_BT' panelId='-1' x='2.06381' y='-2.42958' z='56.0072' xsz='2.1982' ysz='2.1982' zsz='2.1982' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='BufferSize' data='128' />
						<value target='StorageType' data='000' />
						<value target='MemType' data='000' />
						<value target='RETURN' data='000' />
						<value target='Console' data='0' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='4b470b69-a5ec-4c2c-9b3e-67c88ba17583' vmin='5' vmaj='1' codename='CB_AUDIO' panelId='-1' x='7.95331' y='-2.36096' z='41.2305' xsz='-2' ysz='-2' zsz='20' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='BufferSize' data='128' />
						<value target='StorageType' data='000' />
						<value target='MemType' data='000' />
						<value target='RETURN' data='000' />
						<value target='Console' data='0' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='d45b78bf-398d-4b6c-81f0-8c82f6cec907' vmin='2' vmaj='1' codename='USBSwitch' panelId='-1' x='-6.98488' y='-2.47869' z='57.1519' xsz='0.10991' ysz='0.10991' zsz='0.10991' 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' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='pin' data='$PORTA.0' />
						<value target='polarity' data='000' />
						<value target='debounce' data='10' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
				<component class_type='ref' guid='5d9a2513-83f9-4269-acd8-b36e57d300ed' vmin='2' vmaj='1' codename='AutoVersionID1' panelId='-1' x='5.13321' y='-2.34448' z='56.0072' xsz='2.74775' ysz='2.74775' zsz='2.74775' 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='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
					<resources />
					<properties />
					<values >
						<value target='BuildNumber' data='0' />
						<value target='DateDivider' data='/' />
						<value target='TimeDivider' data=':' />
						<value target='DateFormat' data='000' />
						<value target='LastBuildDate' data='08/10/26' />
						<value target='LastBuildTime' data='12:08:57' />
					</values>
					<events />
					<apis />
					<variables />
					<macros />
				</component>
			</component>
			<component class_type='ref' guid='248e0a81-43e3-4ff7-b87d-69c04add1fb9' vmin='1' vmaj='0' codename='LED0' panelId='-1' x='-38' y='-14' z='-15.8' xsz='0.4' ysz='0.3' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTE.0' />
					<value target='polarity' data='001' />
					<value target='on_color' data='255' />
					<value target='Shape' data='000' />
					<value target='width' data='5.000000' />
					<value target='height' data='5.000000' />
					<value target='depth' data='2.500000' />
					<value target='show_label' data='000' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='248e0a81-43e3-4ff7-b87d-69c04add1fb9' vmin='1' vmaj='0' codename='LED1' panelId='-1' x='-38' y='-10' z='-15.8' xsz='0.4' ysz='0.3' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTE.1' />
					<value target='polarity' data='001' />
					<value target='on_color' data='255' />
					<value target='Shape' data='000' />
					<value target='width' data='5.000000' />
					<value target='height' data='5.000000' />
					<value target='depth' data='2.500000' />
					<value target='show_label' data='000' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='248e0a81-43e3-4ff7-b87d-69c04add1fb9' vmin='1' vmaj='0' codename='LED2' panelId='-1' x='-38' y='-6' z='-15.8' xsz='0.4' ysz='0.3' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTE.2' />
					<value target='polarity' data='001' />
					<value target='on_color' data='255' />
					<value target='Shape' data='000' />
					<value target='width' data='5.000000' />
					<value target='height' data='5.000000' />
					<value target='depth' data='2.500000' />
					<value target='show_label' data='000' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='248e0a81-43e3-4ff7-b87d-69c04add1fb9' vmin='1' vmaj='0' codename='LED3' panelId='-1' x='-38' y='-2' z='-15.8' xsz='0.4' ysz='0.3' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTE.3' />
					<value target='polarity' data='001' />
					<value target='on_color' data='255' />
					<value target='Shape' data='000' />
					<value target='width' data='5.000000' />
					<value target='height' data='5.000000' />
					<value target='depth' data='2.500000' />
					<value target='show_label' data='000' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='248e0a81-43e3-4ff7-b87d-69c04add1fb9' vmin='1' vmaj='0' codename='LED4' panelId='-1' x='-38' y='2' z='-15.8' xsz='0.4' ysz='0.3' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTE.4' />
					<value target='polarity' data='001' />
					<value target='on_color' data='255' />
					<value target='Shape' data='000' />
					<value target='width' data='5.000000' />
					<value target='height' data='5.000000' />
					<value target='depth' data='2.500000' />
					<value target='show_label' data='000' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='248e0a81-43e3-4ff7-b87d-69c04add1fb9' vmin='1' vmaj='0' codename='LED5' panelId='-1' x='-38' y='6' z='-15.8' xsz='0.4' ysz='0.3' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTE.5' />
					<value target='polarity' data='001' />
					<value target='on_color' data='255' />
					<value target='Shape' data='000' />
					<value target='width' data='5.000000' />
					<value target='height' data='5.000000' />
					<value target='depth' data='2.500000' />
					<value target='show_label' data='000' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='248e0a81-43e3-4ff7-b87d-69c04add1fb9' vmin='1' vmaj='0' codename='LED6' panelId='-1' x='-38' y='10' z='-15.8' xsz='0.4' ysz='0.3' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTE.6' />
					<value target='polarity' data='001' />
					<value target='on_color' data='255' />
					<value target='Shape' data='000' />
					<value target='width' data='5.000000' />
					<value target='height' data='5.000000' />
					<value target='depth' data='2.500000' />
					<value target='show_label' data='000' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='248e0a81-43e3-4ff7-b87d-69c04add1fb9' vmin='1' vmaj='0' codename='LED7' panelId='-1' x='-38' y='14' z='-15.8' xsz='0.4' ysz='0.3' 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='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTE.7' />
					<value target='polarity' data='001' />
					<value target='on_color' data='255' />
					<value target='Shape' data='000' />
					<value target='width' data='5.000000' />
					<value target='height' data='5.000000' />
					<value target='depth' data='2.500000' />
					<value target='show_label' data='000' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='960e433c-1295-4aeb-ac84-04d75422119e' vmin='0' vmaj='1' codename='SensorLibraryComponent1' panelId='0' x='807.315' y='-284' z='1' xsz='102.174' ysz='102.447' zsz='100' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Text::sText' data='Additional Sensors' />
					<value target='ShowName' data='0' />
					<value target='Name' data='FormulaAllCode' />
					<value target='Peripheral::sText' data='' />
					<value target='ShowComms' data='0' />
					<value target='InputIcon::CommsType' data='255' />
					<value target='OutputIcon::CommsType' data='255' />
					<value target='OutputIcon::LinkTo' data='0' />
					<value target='ConsoleHandle' data='0' />
					<value target='NumDP' data='0' />
					<value target='ValueCount' data='002' />
					<value target='Label0::sText' data='Light' />
					<value target='Max0' data='4096.0' />
					<value target='Min0' data='0.000000' />
					<value target='MajTick0' data='4' />
					<value target='MinTick0' data='128.0' />
					<value target='Label1::sText' data='Sound' />
					<value target='Max1' data='4096.0' />
					<value target='Min1' data='0.000000' />
					<value target='MajTick1' data='4' />
					<value target='MinTick1' data='128.0' />
					<value target='Label2::sText' data='Val 2' />
					<value target='Max2' data='100.000000' />
					<value target='Min2' data='0.000000' />
					<value target='MajTick2' data='10' />
					<value target='MinTick2' data='2.000000' />
					<value target='Label3::sText' data='Val 3' />
					<value target='Max3' data='100.000000' />
					<value target='Min3' data='0.000000' />
					<value target='MajTick3' data='10' />
					<value target='MinTick3' data='2.000000' />
					<value target='Label4::sText' data='Val 4' />
					<value target='Max4' data='100.000000' />
					<value target='Min4' data='0.000000' />
					<value target='MajTick4' data='10' />
					<value target='MinTick4' data='2.000000' />
					<value target='Label5::sText' data='Val 5' />
					<value target='Max5' data='100.000000' />
					<value target='Min5' data='0.000000' />
					<value target='MajTick5' data='10' />
					<value target='MinTick5' data='2.000000' />
					<value target='Label6::sText' data='Val 6' />
					<value target='Max6' data='100.000000' />
					<value target='Min6' data='0.000000' />
					<value target='MajTick6' data='10' />
					<value target='MinTick6' data='2.000000' />
					<value target='Label7::sText' data='Val 7' />
					<value target='Max7' data='100.000000' />
					<value target='Min7' data='0.000000' />
					<value target='MajTick7' data='10' />
					<value target='MinTick7' data='2.000000' />
					<value target='Label8::sText' data='Val 8' />
					<value target='Max8' data='100.000000' />
					<value target='Min8' data='0.000000' />
					<value target='MajTick8' data='10' />
					<value target='MinTick8' data='2.000000' />
					<value target='Label9::sText' data='Val 9' />
					<value target='Max9' data='100.000000' />
					<value target='Min9' data='0.000000' />
					<value target='MajTick9' data='10' />
					<value target='MinTick9' data='2.000000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='960e433c-1295-4aeb-ac84-04d75422119e' vmin='0' vmaj='1' codename='SensorLibraryIR' panelId='0' x='86.5839' y='-185.5' z='2' xsz='100.869' ysz='100.604' zsz='100' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Text::sText' data='IR Sensors' />
					<value target='ShowName' data='0' />
					<value target='Name' data='' />
					<value target='Peripheral::sText' data='' />
					<value target='ShowComms' data='0' />
					<value target='InputIcon::CommsType' data='255' />
					<value target='OutputIcon::CommsType' data='255' />
					<value target='OutputIcon::LinkTo' data='0' />
					<value target='ConsoleHandle' data='0' />
					<value target='NumDP' data='0' />
					<value target='ValueCount' data='010' />
					<value target='Label0::sText' data='0 - Left' />
					<value target='Max0' data='4096.0' />
					<value target='Min0' data='0.000000' />
					<value target='MajTick0' data='4' />
					<value target='MinTick0' data='128.0' />
					<value target='Label1::sText' data='1 - Front Left' />
					<value target='Max1' data='4096.0' />
					<value target='Min1' data='0.000000' />
					<value target='MajTick1' data='4' />
					<value target='MinTick1' data='128.0' />
					<value target='Label2::sText' data='2 - Front' />
					<value target='Max2' data='4096.0' />
					<value target='Min2' data='0.000000' />
					<value target='MajTick2' data='4' />
					<value target='MinTick2' data='128.0' />
					<value target='Label3::sText' data='3 - Front Right' />
					<value target='Max3' data='4096.0' />
					<value target='Min3' data='0.000000' />
					<value target='MajTick3' data='4' />
					<value target='MinTick3' data='128.0' />
					<value target='Label4::sText' data='4 - Right' />
					<value target='Max4' data='4096.0' />
					<value target='Min4' data='0.000000' />
					<value target='MajTick4' data='4' />
					<value target='MinTick4' data='128.0' />
					<value target='Label5::sText' data='5 - Rear Right' />
					<value target='Max5' data='4096.0' />
					<value target='Min5' data='0.000000' />
					<value target='MajTick5' data='4' />
					<value target='MinTick5' data='128.0' />
					<value target='Label6::sText' data='6 - Rear' />
					<value target='Max6' data='4096.0' />
					<value target='Min6' data='0.000000' />
					<value target='MajTick6' data='4' />
					<value target='MinTick6' data='128.0' />
					<value target='Label7::sText' data='7 - Rear Left' />
					<value target='Max7' data='4096.0' />
					<value target='Min7' data='0.000000' />
					<value target='MajTick7' data='4' />
					<value target='MinTick7' data='128.0' />
					<value target='Label8::sText' data='0 - Line Left' />
					<value target='Max8' data='4096.0' />
					<value target='Min8' data='0.000000' />
					<value target='MajTick8' data='4' />
					<value target='MinTick8' data='128.0' />
					<value target='Label9::sText' data='1 - Line Right' />
					<value target='Max9' data='4096.0' />
					<value target='Min9' data='0.000000' />
					<value target='MajTick9' data='4' />
					<value target='MinTick9' data='128.0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='b07ae733-c144-4558-979a-be737044519c' vmin='2' vmaj='1' codename='LED_Array1' panelId='0' x='340.698' y='-88.0617' z='3' xsz='40' ysz='12' 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='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Count' data='005' />
					<value target='SimulationOnly' data='1' />
					<value target='port' data='000' />
					<value target='PortByte' data='$PORTA' />
					<value target='Pin0' data='$PORTA.0' />
					<value target='Pin1' data='$PORTA.1' />
					<value target='Pin2' data='$PORTA.2' />
					<value target='Pin3' data='$PORTA.3' />
					<value target='Pin4' data='$PORTA.4' />
					<value target='Pin5' data='$PORTA.5' />
					<value target='Pin6' data='$PORTA.6' />
					<value target='Pin7' data='$PORTA.7' />
					<value target='Polarity' data='001' />
					<value target='bitmask' data='255' />
					<value target='inv_bitmask' data='-256' />
					<value target='Label' data='002' />
					<value target='LEDMono1::GdiText2::sText' data='LED_Array1' />
					<value target='LEDMono2::GdiText2::sText' data='' />
					<value target='LEDMono3::GdiText2::sText' data='' />
					<value target='LEDMono4::GdiText2::sText' data='' />
					<value target='LEDMono5::GdiText2::sText' data='' />
					<value target='LEDMono6::GdiText2::sText' data='' />
					<value target='LEDMono7::GdiText2::sText' data='' />
					<value target='LEDMono8::GdiText2::sText' data='' />
					<value target='SwitchLayout' data='000' />
					<value target='DistanceBetweenLEDs' data='38' />
					<value target='Style' data='001' />
					<value target='Shape' data='001' />
					<value target='Colour' data='001' />
					<value target='label_colour' data='7895160' />
					<value target='ShowConnectionLabel' data='0' />
					<value target='ShowPinValue' data='0' />
					<value target='AutoOffColour' data='1' />
					<value target='OnColour' data='255' />
					<value target='OffColour' data='42' />
					<value target='Enabled' data='1' />
					<value target='AppDevDetected' data='0' />
					<value target='Product' data='PIC16' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='cd8da0fe-80cf-4532-bb50-69f0d1730e70' vmin='0' vmaj='14' codename='SwitchArrayPush1' panelId='0' x='582.066' y='-486.39' z='4' xsz='25.1526' ysz='34' 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='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='count' data='002' />
					<value target='AppDevDetected' data='0' />
					<value target='SimulationOnly' data='0' />
					<value target='InputMode' data='000' />
					<value target='PortByte' data='$PORTA' />
					<value target='pin0' data='$PORTA.0' />
					<value target='pin1' data='$PORTA.1' />
					<value target='pin2' data='$PORTA.2' />
					<value target='pin3' data='$PORTA.3' />
					<value target='pin4' data='$PORTA.4' />
					<value target='pin5' data='$PORTA.5' />
					<value target='pin6' data='$PORTA.6' />
					<value target='pin7' data='$PORTA.7' />
					<value target='Polarity' data='000' />
					<value target='debounce' data='20' />
					<value target='Latching' data='001' />
					<value target='Label' data='002' />
					<value target='Switch_Push1::GdiText2::sText' data='SwitchArrayPush1' />
					<value target='Switch_Push2::GdiText2::sText' data='' />
					<value target='Switch_Push3::GdiText2::sText' data='' />
					<value target='Switch_Push4::GdiText2::sText' data='' />
					<value target='Switch_Push5::GdiText2::sText' data='' />
					<value target='Switch_Push6::GdiText2::sText' data='' />
					<value target='Switch_Push7::GdiText2::sText' data='' />
					<value target='Switch_Push8::GdiText2::sText' data='' />
					<value target='SwitchLayout' data='000' />
					<value target='DistanceBetweenSwitches' data='400' />
					<value target='Style' data='000' />
					<value target='nType' data='002' />
					<value target='sLabelOn' data='On' />
					<value target='sLabelOff' data='Off' />
					<value target='LabelColour' data='3947580' />
					<value target='ShowConnectionLabel' data='0' />
					<value target='ShowPinValue' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='GdiShape' codename='Wall1' panelId='0' x='375' y='-272.5' z='0' xsz='225' ysz='164.062' zsz='2.84217e-14' xang='1.41645e-05' yang='47.0001' zang='-15' xquat='-0.0520472' yquat='-0.395338' zquat='0.1197' wquat='-0.909214' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='8' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='46' >
				<resources />
				<properties />
				<values >
					<value target='nType' data='  0' />
					<value target='iSubStyle' data='0' />
					<value target='iRounding' data='25' />
					<value target='colFill' data='9868950' />
					<value target='colFillGradient' data='16777215' />
					<value target='nGradientStyle' data='0' />
					<value target='nFillOpacity' data='1.0' />
					<value target='nStyle' data='0' />
					<value target='bFixedScale' data='0' />
					<value target='fThickness' data='1.00000' />
					<value target='iOutlineSize' data='1' />
					<value target='colOutline' data='0' />
					<value target='colOutlineGradient' data='0' />
					<value target='nOutlineStyle' data='0' />
					<value target='nOutlineOpacity' data='1.0' />
					<value target='bTooltipEnable' data='0' />
					<value target='sTooltipText' data='' />
					<value target='sTooltipDesc' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='GdiText' codename='Text1' panelId='0' x='375' y='-30' z='5' xsz='225' ysz='12.5' zsz='0' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='46' >
				<resources />
				<properties />
				<values >
					<value target='sText' data='Formula AllCode Overview' />
					<value target='bWordWrap' data='0' />
					<value target='nHorizontalAlignment' data='2' />
					<value target='nVerticalAlignment' data='2' />
					<value target='nAngle' data='0' />
					<value target='fntFamily' data='Calibri' />
					<value target='bFixedScale' data='0' />
					<value target='dScale' data='1.5' />
					<value target='bScaleWidth' data='0' />
					<value target='iFontSize' data='12' />
					<value target='bBold' data='1' />
					<value target='bItalic' data='0' />
					<value target='bUnderline' data='0' />
					<value target='bStrikethrough' data='0' />
					<value target='colTextColour' data='0' />
					<value target='colTextGradient' data='9868950' />
					<value target='nGradient' data='0' />
					<value target='nTextOpacity' data='1.0' />
					<value target='colBackgroundColour' data='-1' />
					<value target='colBackgroundGradient' data='-1' />
					<value target='nBackgroundGradient' data='0' />
					<value target='nBackgroundOpacity' data='1.0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='b07ae733-c144-4558-979a-be737044519c' vmin='2' vmaj='1' codename='LEDs' panelId='0' x='517.935' y='-500.605' z='6' xsz='25.1474' ysz='26.3247' 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='2' poslock='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Count' data='008' />
					<value target='SimulationOnly' data='0' />
					<value target='port' data='000' />
					<value target='PortByte' data='$PORTE_L' />
					<value target='Pin0' data='$PORTE_L.0' />
					<value target='Pin1' data='$PORTE_L.1' />
					<value target='Pin2' data='$PORTE_L.2' />
					<value target='Pin3' data='$PORTE_L.3' />
					<value target='Pin4' data='$PORTE_L.4' />
					<value target='Pin5' data='$PORTE_L.5' />
					<value target='Pin6' data='$PORTE_L.6' />
					<value target='Pin7' data='$PORTE_L.7' />
					<value target='Polarity' data='001' />
					<value target='bitmask' data='255' />
					<value target='inv_bitmask' data='-256' />
					<value target='Label' data='002' />
					<value target='LEDMono1::GdiText2::sText' data='LED_Array1' />
					<value target='LEDMono2::GdiText2::sText' data='' />
					<value target='LEDMono3::GdiText2::sText' data='' />
					<value target='LEDMono4::GdiText2::sText' data='' />
					<value target='LEDMono5::GdiText2::sText' data='' />
					<value target='LEDMono6::GdiText2::sText' data='' />
					<value target='LEDMono7::GdiText2::sText' data='' />
					<value target='LEDMono8::GdiText2::sText' data='' />
					<value target='SwitchLayout' data='000' />
					<value target='DistanceBetweenLEDs' data='40' />
					<value target='Style' data='001' />
					<value target='Shape' data='001' />
					<value target='Colour' data='001' />
					<value target='label_colour' data='7895160' />
					<value target='ShowConnectionLabel' data='0' />
					<value target='ShowPinValue' data='0' />
					<value target='AutoOffColour' data='1' />
					<value target='OnColour' data='255' />
					<value target='OffColour' data='42' />
					<value target='Enabled' data='1' />
					<value target='AppDevDetected' data='0' />
					<value target='Product' data='PIC16' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='b07ae733-c144-4558-979a-be737044519c' vmin='2' vmaj='1' codename='LED_Array2' panelId='0' x='657.817' y='-87.5643' z='7' xsz='40' ysz='12' 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='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Count' data='005' />
					<value target='SimulationOnly' data='1' />
					<value target='port' data='000' />
					<value target='PortByte' data='$PORTA' />
					<value target='Pin0' data='$PORTA.0' />
					<value target='Pin1' data='$PORTA.1' />
					<value target='Pin2' data='$PORTA.2' />
					<value target='Pin3' data='$PORTA.3' />
					<value target='Pin4' data='$PORTA.4' />
					<value target='Pin5' data='$PORTA.5' />
					<value target='Pin6' data='$PORTA.6' />
					<value target='Pin7' data='$PORTA.7' />
					<value target='Polarity' data='001' />
					<value target='bitmask' data='255' />
					<value target='inv_bitmask' data='-256' />
					<value target='Label' data='002' />
					<value target='LEDMono1::GdiText2::sText' data='LED_Array1' />
					<value target='LEDMono2::GdiText2::sText' data='' />
					<value target='LEDMono3::GdiText2::sText' data='' />
					<value target='LEDMono4::GdiText2::sText' data='' />
					<value target='LEDMono5::GdiText2::sText' data='' />
					<value target='LEDMono6::GdiText2::sText' data='' />
					<value target='LEDMono7::GdiText2::sText' data='' />
					<value target='LEDMono8::GdiText2::sText' data='' />
					<value target='SwitchLayout' data='000' />
					<value target='DistanceBetweenLEDs' data='38' />
					<value target='Style' data='001' />
					<value target='Shape' data='001' />
					<value target='Colour' data='001' />
					<value target='label_colour' data='7895160' />
					<value target='ShowConnectionLabel' data='0' />
					<value target='ShowPinValue' data='0' />
					<value target='AutoOffColour' data='1' />
					<value target='OnColour' data='255' />
					<value target='OffColour' data='42' />
					<value target='Enabled' data='1' />
					<value target='AppDevDetected' data='0' />
					<value target='Product' data='PIC16' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7e19b0ee-6cfd-49d3-8efb-67e7b145dfba' vmin='5' vmaj='1' codename='Display' panelId='0' x='355.874' y='-404.5' z='8' xsz='116.274' ysz='47.16' zsz='30' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' angle2d='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pixel_width' data='128' />
					<value target='pixel_height' data='32' />
					<value target='NumBytes' data='512' />
					<value target='monochrome' data='1' />
					<value target='foreground_colour' data='0' />
					<value target='background_colour' data='16777215' />
					<value target='colour_bit_depth' data='1' />
					<value target='red_bit_depth' data='0' />
					<value target='green_bit_depth' data='0' />
					<value target='blue_bit_depth' data='0' />
					<value target='data_pin' data='$PORTA.0' />
					<value target='clock_pin' data='$PORTA.1' />
					<value target='a0_pin' data='$PORTA.2' />
					<value target='chip_sel_pin' data='$PORTA.3' />
					<value target='reset_pin' data='$PORTA.4' />
					<value target='Base_GLCD::FontCount' data='001' />
					<value target='Base_GLCD::gLCD_Font1::Font' data='000' />
					<value target='Base_GLCD::gLCD_Font1::CustomFontFile' data='' />
					<value target='Base_GLCD::gLCD_Font1::BytesRequired' data='' />
					<value target='Base_GLCD::gLCD_Font1::FontSpace' data='001' />
					<value target='Base_GLCD::gLCD_Font1::SpaceWidth' data='5' />
					<value target='Base_GLCD::gLCD_Font2::Font' data='005' />
					<value target='Base_GLCD::gLCD_Font2::CustomFontFile' data='' />
					<value target='Base_GLCD::gLCD_Font2::BytesRequired' data='' />
					<value target='Base_GLCD::gLCD_Font8::FontSpace' data='' />
					<value target='Base_GLCD::gLCD_Font2::SpaceWidth' data='004' />
					<value target='Base_GLCD::gLCD_Font3::Font' data='002' />
					<value target='Base_GLCD::gLCD_Font3::CustomFontFile' data='' />
					<value target='Base_GLCD::gLCD_Font3::BytesRequired' data='' />
					<value target='Base_GLCD::gLCD_Font3::SpaceWidth' data='004' />
					<value target='Base_GLCD::gLCD_Font4::Font' data='015' />
					<value target='Base_GLCD::gLCD_Font4::CustomFontFile' data='' />
					<value target='Base_GLCD::gLCD_Font4::BytesRequired' data='' />
					<value target='Base_GLCD::gLCD_Font4::SpaceWidth' data='004' />
					<value target='DisplayMethod' data='000' />
					<value target='Base_GLCD::PhysicalOrientation' data='000' />
					<value target='LCDVersion' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='12583104' img='' style='0' />
		<camera xe='20.94' ye='9.03295' ze='70.6443' xt='20.94' yt='9.03295' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='405' dy='396' zoom='693.687' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='0' />
		<winpos ID='7005' RectRecentFloat='1219,463,1869,913' RectRecentDocked='0,0,405,419' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel2d>
	<panel3d shadows='1' lighting='0' brightness='153' perspective='1' >
		<background rgb='16777120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0.974074' ye='1.05871' ze='307.528' xt='0.974074' yt='1.05871' zt='-24.0211' xquat='0' yquat='0' zquat='0' wquat='1' />
		<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='694,355,1719,917' RectRecentDocked='378,577,1451,1013' RecentFrameAlignment='32768' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel3d>
	<panels2d count='1' >
		<panel2d_0 id='0' name='NewPanel' type='0' >
			<winpos ID='1171' RectRecentFloat='323,180,1294,808' RectRecentDocked='915,141,1451,571' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='1' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='1' />
			<background fill='288230376151053813' showgrid='1' gridstyle='0' gridsize='5' gridbrush='71776119075691740' snaptogrid='1' fitcomp='0' disp_x='300' disp_y='400' scale='100' disp_col='16777215' />
		</panel2d_0>
	</panels2d>
	<layout >
		<view type='0' name='SetMotors' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetMotorsInterrupt' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Interrupt_MotorTimer' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='CheckLine_Sim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='CheckLine' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='CheckIR_Sim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='CheckIR' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LogoForwardsSim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LogoTurnRightSim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LogoTurnLeftSim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LogoBackwardsSim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_Timer' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='InitialiseSim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='BattMon' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Interrupt_BluetoothRX' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='BluetoothReceive' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='BluetoothCheckRx' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadIRSensor' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='61' flags='0' />
		<view type='0' name='BluetoothCommand' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='BluetoothTransmit' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Interrupt_Audio' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='AudioStreamControl' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LogoProcess' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='2113' flags='0' />
		<view type='0' name='LogoTurnRight' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LogoTurnLeft' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LogoBackwards' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LogoForwards' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LogoConfigure' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='PlayNote' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='70' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetEEFloat' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='GetEEFloat' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadMic' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Interrupt_Encoder' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='BluetoothTransmitString' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LCDPrintNumber' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LEDWrite' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadBattery' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_Property' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='362' flags='0' />
		<view type='0' name='ReadIRSensor_Sim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='75' scrollx='0' scrolly='1052' flags='0' />
		<view type='0' name='LCDClear' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LCDSetForegroundColour' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='CheckUSB' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LCDDrawRectangle' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LCDSetBackgroundColour' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='AudioReadFromBuffer' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LCDPlotPixel' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LCDBacklight' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='BluetoothQueueLength' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LCDDrawLine' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='AudioAddToBuffer' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LCDPrintString' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Sim_Draw2DRobot' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LEDOn' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='LEDOff' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALAQAAF0CAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
