<root>
<document scada='0' schema='102' license='1,79829088,0H6AEK' title='' description='' fcversion='590336' target='ARD.ATMEGA.Arduino Nano 328 115200' >
	<config data='' clkspd='16000000' simspd='0' usewdt='0' constif='0' commport='4' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='state' />
		<watch expr='PinChange.pulse' />
		<watch expr='RcvSim.times' />
		<watch expr='RcvSim.i' />
		<watch expr='pos' />
	</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='11' />
			<data name='CalculatedCommsDelay' value='11' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='0' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='58f32e38-8e22-4275-88f1-9b98e8043fa2' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' category2='' category3='' bIs2dOnly='0' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<gdiopts FullContainer='1' FullTransparency='1' ShowGdi='1' ShowOpengl='1' />
		<component class_type='root' codename='panel' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' comp2dType='0' >
			<resources />
			<properties >
				<property name='IR Pin' target='pin' typeid='5' hidden='0' locked='0' info='' />
			</properties>
			<values >
				<value target='pin' data='$PORTD.2' />
			</values>
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='IDLE' type='s16' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='IsSim' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='END' type='s16' description='' isconst='1' isHidden='0' isinit='1' usrinit='10' setinit='10' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='length' type='u16' description='Length of pulse in sim' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</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='READ' type='s16' description='' isconst='1' isHidden='0' isinit='1' usrinit='8' setinit='8' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DATA' type='s16' description='' isconst='1' isHidden='0' isinit='1' usrinit='6' setinit='6' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='pos' type='u8' description='Current pulse to receive' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='state' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='1' setinit='IDLE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rcvd' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='4' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='START' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='4' setinit='4' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOF' type='s16' description='' isconst='1' isHidden='0' isinit='1' usrinit='5' setinit='5' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='PinChange' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='pulse' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='i' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='dat' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='index' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='143324' cmdcolor_sec='3432959' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' exp='IsSim' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
									<exp exp='.pulse = length' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='...............' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='Timer1' macro='GetCountMicroSeconds' >
									<return exp='.pulse' />
								</command>
								<command class_type='call' title='Component Macro' ccode='// Name: Component Macro
FCD_026e1_Timer1__ResetCounter();' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='Timer1' macro='ResetCounter' />
							</flowline>
						</command>
						<command class_type='switch' title='Handle pulse..' textarea='36,25,36,25' cmdcolor='286184' cmdcolor_sec='3575807' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' exp='state' >
							<case >
								<flowline />
							</case>
							<case exp='START' >
								<flowline >
									<command class_type='decision' title='Need a 9ms pulse to start' cmdcolor='143324' cmdcolor_sec='3432959' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' exp='(.pulse &gt;= 8000) &amp;&amp; (.pulse &lt; 10000)' swap='0' >
										<flowline >
											<command class_type='calculation' title='Clear data = moved here to allow for repeat signal' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
												<exp exp='pos = 0' />
												<exp exp='rcvd[0] = 0' />
												<exp exp='rcvd[1] = 0' />
												<exp exp='rcvd[2] = 0' />
												<exp exp='rcvd[3] = 0' />
											</command>
											<command class_type='calculation' title='Calculation' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
												<exp exp='state = SOF' />
											</command>
										</flowline>
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
												<exp exp='state = IDLE' />
											</command>
										</flowline>
									</command>
								</flowline>
							</case>
							<case exp='SOF' >
								<flowline >
									<command class_type='decision' title='Need a 4.5ms space .to start' cmdcolor='143324' cmdcolor_sec='3432959' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' exp='(.pulse &gt;= 3000) &amp;&amp; (.pulse &lt; 6000)' swap='0' >
										<flowline >
											<command class_type='calculation' title='............' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
												<exp exp='state = DATA' />
											</command>
										</flowline>
										<flowline />
									</command>
								</flowline>
							</case>
							<case exp='DATA' >
								<flowline >
									<command class_type='decision' title='562us pulse is start of bit' cmdcolor='143324' cmdcolor_sec='3432959' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' exp='(.pulse &gt; 400) &amp;&amp; (.pulse &lt; 620)' swap='0' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
												<exp exp='state = READ' />
											</command>
										</flowline>
										<flowline />
									</command>
								</flowline>
							</case>
							<case exp='READ' >
								<flowline >
									<command class_type='calculation' title='Calculation' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
										<exp exp='.index = pos &gt;&gt; 3' />
										<exp exp='.dat = rcvd[.index] &gt;&gt; 1' />
									</command>
									<command class_type='decision' title='Long gap = 1 ' cmdcolor='143324' cmdcolor_sec='3432959' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' exp='(.pulse &gt; 1500) &amp;&amp; (.pulse &lt; 1800)' swap='0' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
												<exp exp='.dat = .dat | 0x80' />
											</command>
										</flowline>
										<flowline />
									</command>
									<command class_type='calculation' title='Calculation' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
										<exp exp='rcvd[.index] = .dat' />
										<exp exp='state = DATA' />
										<exp exp='pos = pos + 1' />
									</command>
									<command class_type='decision' title='Read 4 bytes?' cmdcolor='143324' cmdcolor_sec='3432959' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' exp='pos = 32' swap='0' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
												<exp exp='state = END' />
											</command>
											<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='Timer1' macro='StopCounter' />
										</flowline>
										<flowline />
									</command>
								</flowline>
							</case>
							<case exp='IDLE' >
								<flowline >
									<command class_type='calculation' title='Expect start (long) pulse' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
										<exp exp='state = START' />
									</command>
									<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='Timer1' macro='StartCounter' >
										<argument exp='true' />
									</command>
								</flowline>
							</case>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SendSim' description='Simulates sending / rceceiving data from an NEC IR controller' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='addr' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='cmd' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='data' type='u8' description='Data to send' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='4' />
						</local>
						<local name='pos' type='u8' description='Bit position in output data' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='bit' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='index' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='We might mess with these figures to test error handling?' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
							<exp exp='.data[0] = .addr' />
							<exp exp='.data[1] = ~ .addr' />
							<exp exp='.data[2] = .cmd' />
							<exp exp='.data[3] = ~ .cmd' />
							<exp exp='' />
							<exp exp='// Send start of DATA' />
							<exp exp='pin = 0' />
							<exp exp='length = 9000 // 9ms start of DATA' />
							<exp exp='pin = 1' />
							<exp exp='length = 4500 // followed by 4.5ms gap' />
							<exp exp='pin = 0' />
						</command>
						<command class_type='loop' title='Output 32 bits of data' cmdcolor='572159' cmdcolor_sec='3861759' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' type='2' forvar='.pos' exp='32' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
									<exp exp='.bit = .pos % 8' />
									<exp exp='.index = .pos / 8' />
									<exp exp='length = 562' />
									<exp exp='pin = !pin' />
								</command>
								<command class_type='decision' title='Data is send LSB first' cmdcolor='143324' cmdcolor_sec='3432959' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' exp='.data[.index] &amp; (1 &lt;&lt; .bit)' swap='0' >
									<flowline >
										<command class_type='calculation' title='&apos;1&apos; bit has long gap' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
											<exp exp='length = 1687' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='&apos;0&apos; has short gap' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
											<exp exp='length = 562' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Toggle the pin' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
									<exp exp='pin = !pin' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Final pulse' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
							<exp exp='length = 562' />
							<exp exp='pin = !pin' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
							<exp exp='pin = 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Display' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='desc' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<param name='a' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='b' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='PrintString' >
							<argument exp='.desc' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='PrintString' >
							<argument exp='&quot;  &quot;' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='PrintNumber' >
							<argument exp='.a' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='PrintString' >
							<argument exp='&quot; &quot;' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='PrintNumber' >
							<argument exp='.b' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='PrintString' >
							<argument exp='&quot;    &quot;' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='i' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='addr' type='u8' description='Data to Send' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='cmd' type='u8' description='Data to Send' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='Start' />
						<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='Cursor' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='PrintString' >
							<argument exp='&quot;NEC IR Receive Test&quot;' />
						</command>
						<command class_type='calculation' title='Simulate with pin going low on pulse..' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
							<exp exp='pin = 1' />
							<exp exp='IsSim = IsSim1 :: Check ()' />
						</command>
						<command class_type='interrupt' title='Pretend only have interrupt on falling or rising edge (not both)' ccode='// Name: Pretend only have interrupt on falling or rising edge (not both)
EICRA |= (1 &lt;&lt; ISC01);
EICRA &amp;= ~(1 &lt;&lt; ISC00);
sei();
EIMSK |= (1 &lt;&lt; INT0);
' cmdcolor='286184' cmdcolor_sec='3575807' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' enable='1' name='INT0' call='PinChange' >
							<settings timer='0' prescale='-1' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='2' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
							</settings>
						</command>
						<command class_type='loop' title='Loop' cmdcolor='572159' cmdcolor_sec='3861759' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' type='0' exp='1' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
									<exp exp='.cmd = Random ()' />
									<exp exp='.addr = Random ()' />
								</command>
								<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='Cursor' >
									<argument exp='0' />
									<argument exp='2' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='524957' cmdcolor_sec='3814607' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' macro='Display' >
									<argument exp='&quot;Send&quot;' />
									<argument exp='.addr' />
									<argument exp='.cmd' />
								</command>
								<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='Cursor' >
									<argument exp='0' />
									<argument exp='3' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='524957' cmdcolor_sec='3814607' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' macro='SendSim' >
									<argument exp='.addr' />
									<argument exp='.cmd' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='143324' cmdcolor_sec='3432959' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' exp='state = END' swap='0' >
									<flowline >
										<command class_type='call' title='User Macro' cmdcolor='524957' cmdcolor_sec='3814607' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' macro='Display' >
											<argument exp='&quot;Rcvd&quot;' />
											<argument exp='rcvd[0]' />
											<argument exp='rcvd[2]' />
										</command>
										<command class_type='calculation' title='Reset buffer' cmdcolor='429300' cmdcolor_sec='3718911' cmdcolor_txt='0' cmdgradient='1' cmdopacity='1' >
											<exp exp='pos = 0' />
											<exp exp='state = IDLE' />
											<exp exp='' />
										</command>
									</flowline>
									<flowline >
										<command class_type='call' title='Component Macro' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' component='LCDAdafruitOLED4x20' macro='PrintString' >
											<argument exp='&quot;Error - no data!&quot;' />
										</command>
									</flowline>
								</command>
								<command class_type='delay' title='Delay' cmdcolor='208' cmdcolor_sec='3289855' cmdcolor_txt='16777215' cmdgradient='1' cmdopacity='1' exp='1' type='2' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='24ad2718-c70b-4088-aeda-3949dfdba740' vmin='1' vmaj='1' codename='Timer1' x='30' y='30' z='0' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Timer' data='000' />
					<value target='BitDepth' data='8' />
					<value target='InstructionRate' data='16000000' />
					<value target='InstructionTime' data='0.000063' />
					<value target='RolloverFreq' data='62500.000000' />
					<value target='RolloverTime' data='0.000016' />
					<value target='RegHighUsed' data='0' />
					<value target='Instance' data='1' />
					<value target='DeviceBits' data='8' />
					<value target='CountRegLow' data='TCNT0' />
					<value target='CountRegHigh' data='' />
					<value target='EnableCode' data='sei(); TIMSK0 |= (1 &lt;&lt; TOIE0);  TCCR0B &amp;= 0xf8; TCCR0B |= 0x01; ' />
					<value target='DisableCode' data='TIMSK0 &amp;= ~(1 &lt;&lt; TOIE0); ' />
					<value target='HandlerCode' data='ISR(TIMER0_OVF_vect) {  TIM_1_INC }' />
					<value target='MaxTimeMeasurement' data='268.435455' />
					<value target='Family' data='ARD' />
					<value target='TimerDelay' data='50' />
					<value target='DecimalPoints' data='3' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='5f7b77e5-e979-4010-93f1-e6d98f83bd71' vmin='0' vmaj='1' codename='IsSim1' x='70' y='30' z='1.55' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Sim' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='913991df-9bcb-475a-ae49-d9eb611b0d71' vmin='10' vmaj='1' codename='LCDAdafruitOLED4x20' x='50' y='70' z='15.201' xsz='80' ysz='36.3' zsz='7.15' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='d0_pin' data='$PORTB.0' />
					<value target='d1_pin' data='$PORTB.1' />
					<value target='d2_pin' data='$PORTB.2' />
					<value target='d3_pin' data='$PORTB.3' />
					<value target='rs_pin' data='$PORTB.4' />
					<value target='rw_pin' data='$PORTB.5' />
					<value target='enable_pin' data='$PORTB.6' />
					<value target='Rows' data='4' />
					<value target='Columns' data='20' />
					<value target='BackgroundColor' data='4720649' />
					<value target='LineColor' data='8388608' />
					<value target='TextColor' data='16776960' />
					<value target='Font' data='Arial' />
					<value target='CursorPosX' data='17' />
					<value target='CursorPosY' data='3' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<camera xe='57.2721' ye='60.0192' ze='154.525' xt='57.2721' yt='60.0192' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='1408' dy='1105' zoom='1102.52' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='7360576' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0' ye='0' ze='781.66' xt='0' yt='0' zt='0' 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' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAiAAAA4g0AAAgGAAA' zoom='100' scrollx='0' scrolly='295' flags='0' />
		<view type='0' name='PinChange' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAiAAAA4g0AAAgGAAA' zoom='100' scrollx='0' scrolly='189' flags='0' />
		<view type='0' name='Display' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAiAAAA4g0AAAgGAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SendSim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAiAAAA4g0AAAgGAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
