<root>
<document scada='0' projtype='1' schema='103' license='1,79829088,Q2XNNM' title='New Embedded Project' description='New &lt;Arduino Uno R3 PDIP&gt; Embedded Project' fcversion='720896' target='ARD.ATMEGA.Arduino Uno R3 PDIP' >
	<config data='' clkspd='16000000' simspd='0' usewdt='0' constif='0' commport='17' SSH_IP='DD6171BB7AD97877' SSH_User='DD6171BB7AD97877' SSH_Pass='DD6171BB7AD97877' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='DisplayData' />
	</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='3' />
			<data name='ClockPin' value='1' />
			<data name='DataPort' value='3' />
			<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='25' fixedy='25' fixedz='25' headcode='0' />
		<definition guid='bf7fac03-4a99-4d86-b140-87b749490aa4' vstate='40' vmin='0' vmaj='1' srcleaf='ShiftReg.fcfx' visiblename='SN74Display' description='' category='Development' category2='' category3='' bIs2dOnly='0' bIs3dOnly='0' bIsWysiwyg='0' catenable='1' author='' manuname='' manucode='' sysinfo='779' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' showmacros='1' iconpath='' />
		<component class_type='root' codename='SN74Display' 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' comp2dType='0' >
			<resources />
			<properties >
				<property name='Devices digits (0..n - 1)' target='devices' typeid='21' hidden='0' locked='1' info='' />
				<property name='Common &apos;Enable&apos;' target='enable' typeid='16' hidden='0' locked='0' info='Set the state of the common pin that enables a digit' filter='000LOW
001HIGH' />
				<property name='Data Out' target='data_out' typeid='5' hidden='0' locked='0' info='' />
				<property name='Serial Clock' target='SCLK' typeid='5' hidden='0' locked='0' info='' />
				<property name='RCLK' target='RCLK' typeid='5' hidden='0' locked='0' info='' />
				<property name='Common 1' target='CA1' typeid='5' hidden='0' locked='0' info='' />
				<property name='Common 2' target='CA2' typeid='5' hidden='0' locked='0' info='' />
				<property name='Common 3' target='CA3' typeid='5' hidden='0' locked='0' info='' />
				<property name='Common 4' target='CA4' typeid='5' hidden='0' locked='0' info='' />
			</properties>
			<values >
				<value target='devices' data='4' />
				<value target='enable' data='000' />
				<value target='data_out' data='$D11' />
				<value target='SCLK' data='$PORTB.5' />
				<value target='RCLK' data='$PORTB.2' />
				<value target='CA1' data='$PORTD.3' />
				<value target='CA2' data='$PORTD.4' />
				<value target='CA3' data='$PORTD.5' />
				<value target='CA4' data='$PORTD.6' />
			</values>
			<events />
			<apis >
				<api name='Display' alt='DisplaySim' type='1' proto='1' />
				<api name='Multiplex' alt='Multiplex' type='1' proto='1' />
				<api name='Initialise' alt='Initialise' type='1' proto='1' />
			</apis>
			<variables >
				<variable public='0' >
					<def class_type='variable' name='dp_pos' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DisplayData' type='u8' description='Characters to display (max 16 digits!)' isconst='0' isHidden='0' isinit='1' usrinit='&quot; \&apos; \&apos;,\&apos; \&apos;,\&apos; \&apos;,\&apos; \&apos; &quot;' setinit='{&apos; &apos;,&apos; &apos;,&apos; &apos;,&apos; &apos;}' >
						<array size='4' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='digit' type='u8' description='Digit to enable' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='lookup' type='u8' description='Lookup table for segment data for digits 0..9' isconst='1' isHidden='0' isinit='1' usrinit='&quot; 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f &quot;' setinit='{0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f}' >
						<array size='10' />
					</def>
				</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='Display' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='x' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='dp_pos' type='u8' description='Digit to set dp (0 off, 1..4 on)' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='i' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='first' type='b1' description='' isconst='0' isHidden='0' isinit='1' usrinit='1' setinit='true' />
						<command class_type='loop' title='Loop' type='2' forvar='.i' exp='devices' >
							<flowline >
								<command class_type='decision' title='Decision' exp='.first || .x' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='DisplayData[devices - .i - 1] = .x % 10 + &apos;0&apos;' />
											<exp exp='.x = .x / 10' />
											<exp exp='.first = false' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='DisplayData[devices - .i - 1] = &apos; &apos;' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Actually we use 0..3  - so use -1 for no dp' >
							<exp exp='dp_pos = .dp_pos - 1' />
						</command>
						<command class_type='decision' title='Decision' exp='.dp_pos' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.dp_pos = .dp_pos - 1' />
								</command>
								<command class_type='loop' title='Loop' type='0' exp='.dp_pos &lt; devices' >
									<flowline >
										<command class_type='decision' title='Decision' exp='DisplayData[.dp_pos] == &apos; &apos;' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='DisplayData[.dp_pos] = &apos;0&apos;' />
												</command>
											</flowline>
											<flowline />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='.dp_pos = .dp_pos + 1' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Multiplex' description='Draws the data to the currently displayed digit. Call as often as required (usually 
from an interrupt) to update the display' 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='d' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.d = DisplayData[digit]' />
						</command>
						<command class_type='decision' title='Decision' exp='.d == &apos; &apos;' swap='0' >
							<flowline >
								<command class_type='calculation' title='Space is blank' >
									<exp exp='.d = 0' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.d = lookup[.d - &apos;0&apos;]' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' exp='dp_pos == digit' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.d = .d | 0x80' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='enable' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.d = ~.d' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Select shift reg' >
							<exp exp='RCLK = 0' />
						</command>
						<command class_type='delay' title='Delay' disable='1' exp='1' type='0' />
						<command class_type='loop' title='Loop' type='2' forvar='.i' exp='8' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='data_out = (.d &amp; 0x80) != 0' />
									<exp exp='.d = .d &lt;&lt; 1' />
									<exp exp='SCLK = 0' />
								</command>
								<command class_type='delay' title='Delay' disable='1' exp='1' type='0' />
								<command class_type='calculation' title='Pin is read on rising clock' >
									<exp exp='SCLK = 1' />
								</command>
								<command class_type='delay' title='Delay' disable='1' exp='1' type='0' />
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='RCLK = 1' />
						</command>
						<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='digit' >
							<case >
								<flowline />
							</case>
							<case exp='0' >
								<flowline >
									<command class_type='calculation' title='Calculation' >
										<exp exp='CA4 = !enable' />
										<exp exp='CA1 = enable' />
									</command>
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='calculation' title='Calculation' >
										<exp exp='CA1 = !enable' />
										<exp exp='CA2 = enable' />
									</command>
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='calculation' title='Calculation' >
										<exp exp='CA2 = !enable' />
										<exp exp='CA3 = enable' />
									</command>
								</flowline>
							</case>
							<case exp='3' >
								<flowline >
									<command class_type='calculation' title='Calculation' >
										<exp exp='CA3 = !enable' />
										<exp exp='CA4 = enable' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='digit = (digit + 1) % devices' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='DisplaySim' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='x' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='dp_pos' type='u8' description='Digit to set dp (0 off, 1..4 on)' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='i' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='first' type='b1' description='' isconst='0' isHidden='0' isinit='1' usrinit='1' setinit='true' />
						<local name='fp' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='calculation' title='Actually we use 0..3  - so use -1 for no dp' >
							<exp exp='dp_pos = .dp_pos - 1' />
							<exp exp='.fp = .x' />
						</command>
						<command class_type='loop' title='Loop' disable='1' type='2' forvar='.i' exp='devices' >
							<flowline >
								<command class_type='decision' title='Decision' exp='.first || .x' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='DisplayData[devices - .i - 1] = .x % 10 + &apos;0&apos;' />
											<exp exp='.x = .x / 10' />
											<exp exp='.first = false' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='DisplayData[devices - .i - 1] = &apos; &apos;' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' exp='.dp_pos' swap='0' >
							<flowline >
								<command class_type='loop' title='Loop' type='0' exp='.dp_pos &lt; devices' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.fp = .fp / 10.0' />
											<exp exp='.dp_pos = .dp_pos + 1' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='sim' title='Component Macro' component='NumericIndicator1' macro='SetValue' >
							<argument exp='.fp' />
						</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='num' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='123' setinit='123' />
						<command class_type='call' title='User Macro' macro='Initialise' />
						<command class_type='interrupt' title='Interrupt' enable='1' name='TMR0' call='Multiplex' >
							<settings timer='1' prescale='256' postscale='-1' rollover='-1' bitcount='-1' trigger='3' ppsport='-1' ppspin='-1' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='4' />
								<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' type='3' exp='1' >
							<flowline >
								<command class_type='call' title='User Macro' macro='Display' >
									<argument exp='.num' />
									<argument exp='2' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.num = .num + 1' />
								</command>
								<command class_type='delay' title='Delay' exp='400' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialise' 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='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='CA1 = !enable' />
							<exp exp='CA2 = !enable' />
							<exp exp='CA3 = !enable' />
							<exp exp='CA4 = !enable' />
							<exp exp='SCLK = 1' />
							<exp exp='RCLK = 1' />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='GdiNumericIndicator' codename='NumericIndicator1' panelId='0' x='130' y='-60' z='0' xsz='50' ysz='12.5' zsz='37.5' 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='8' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='46' >
				<resources />
				<properties />
				<values >
					<value target='dValue' data='0.206' />
					<value target='iResponsiveness' data='1' />
					<value target='nStyle' data='100' />
					<value target='nType' data='  1' />
					<value target='nCellCount' data='004' />
					<value target='bShowDP' data='1' />
					<value target='bShowLeadingZeros' data='0' />
					<value target='bShowSign' data='0' />
					<value target='nDecimalPlaces' data='003' />
					<value target='brFill' data='432151290760396800' />
					<value target='colOutline' data='16777215' />
					<value target='colSeparator' data='16777215' />
					<value target='colDigit' data='255' />
					<value target='colDecimal' data='255' />
					<value target='colDot' data='255' />
					<value target='colSign' data='255' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<camera xe='0' ye='0' ze='2869.03' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='561' dy='1334' zoom='23.6599' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='7360576' />
		<winpos ID='7005' RectRecentFloat='759,742,1292,1110' RectRecentDocked='0,0,561,1384' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='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' />
		<winpos ID='7004' RectRecentFloat='608,268,1011,632' RectRecentDocked='0,0,540,1087' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel3d>
	<panels2d count='1' >
		<panel2d_0 id='0' name='2D Panel' type='0' >
			<winpos ID='1171' RectRecentFloat='2388,264,3038,714' RectRecentDocked='2735,328,3377,1712' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='1' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='1' />
			<background fill='288230376151053813' showgrid='1' gridstyle='1' gridsize='10' gridbrush='71776119075691740' snaptogrid='1' fitcomp='0' disp_x='300' disp_y='400' scale='200' disp_col='16777215' />
		</panel2d_0>
	</panels2d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAzAAAAegsAAGMFAAA' zoom='180' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAzAAAAegsAAGMFAAA' zoom='135' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Multiplex' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAzAAAAegsAAGMFAAA' zoom='190' scrollx='0' scrolly='1335' flags='0' />
		<view type='0' name='Display' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAzAAAAegsAAGMFAAA' zoom='190' scrollx='0' scrolly='807' flags='0' />
		<view type='0' name='DisplaySim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAzAAAAegsAAGMFAAA' zoom='125' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
