<root>
<document scada='0' schema='102' license='1,viktor_aust,WUXBW2' title='' description='' fcversion='524800' target='ARD.ATMEGA.Arduino Nano 328' >
	<config data='' clkspd='16000000' simspd='1' usewdt='0' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<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='6' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='7' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='9' />
			<data name='CalculatedCommsDelay' value='9' />
			<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='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='0' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<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' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='coin_state' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='balls_won' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='balls_total' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='tick' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='count_win' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='flag_win' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='shot_counter' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='secs' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ball_state' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='flag_loop' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='count_balls' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Coin_state' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Coin_detected' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='LedB5' macro='TurnOn' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
							<argument exp='&quot;Token - &gt; OK      &quot;' />
							<argument exp='2' />
							<argument exp='2' />
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='1' type='2' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
							<argument exp='&quot;Time limit - 3 mins &quot;' />
							<argument exp='2' />
							<argument exp='12' />
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='1' type='2' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
							<argument exp='&quot;One won ball adds 2 s &quot;' />
							<argument exp='2' />
							<argument exp='22' />
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='1' type='2' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
							<argument exp='&quot;Game starts now    &quot;' />
							<argument exp='2' />
							<argument exp='32' />
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='1' type='2' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='ClearDisplay' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Credits' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='15 balls won
Use have an extra time: secs = secs - 10
Until time = max?' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
						<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='secs = secs - 10' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Clock' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='This macro runs by interrupt - 75 times / second' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
						<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='tick &gt;= 59' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='tick = 0' />
								</command>
								<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='secs = secs + 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='tick = tick + 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='InitPorts' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='0' port='1048577' mask='0' exp='0' />
						<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='0' port='1048579' mask='0' exp='0' />
						<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='0' port='1048578' mask='0' exp='0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Macro' cmdcolor='1879295' cmdcolor_sec='5751039' macro='InitSsd1306_i2c' />
						<command class_type='call' title='Call Macro' cmdcolor='1879295' cmdcolor_sec='5751039' macro='InitPorts' />
						<command class_type='comment' title='' comment='Read me
----------
Run this program
Press &apos;Insert Coin&apos; button (d4),
Press Ball-Out button,
Release &apos;Insert Coin&apos; button,
Press Ball-Out btn again or left it pressed.
-----------
Test the Win switch (one at a time)
' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
						<command class_type='loop' title='Loop' cmdcolor='12615680' cmdcolor_sec='15376912' type='0' exp='1' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='coin_state = 0' />
								</command>
								<command class_type='call' title='Call Component Macro' textarea='52,21,52,21' cmdcolor='1879295' cmdcolor_sec='5751039' component='SwCoin' macro='ReadState' >
									<return exp='coin_state' />
								</command>
								<command class_type='decision' title='active= high' textarea='52,21,52,21' cmdcolor='12615680' cmdcolor_sec='15376912' exp='coin_state = 1' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='A3 Led' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
										<command class_type='call' title='Call Macro' cmdcolor='1879295' cmdcolor_sec='5751039' macro='Coin_detected' />
										<command class_type='comment' title='' comment='Start game' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
										<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='flag_loop = 0' />
										</command>
										<command class_type='loop' title='Loop' cmdcolor='12615680' cmdcolor_sec='15376912' type='1' exp='flag_loop = 1' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
													<exp exp='ball_state = 0' />
												</command>
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SwBallOut' macro='ReadState' >
													<return exp='ball_state' />
												</command>
												<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='ball_state = 1' swap='0' >
													<flowline >
														<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
															<argument exp='&quot;                  &quot;' />
															<argument exp='2' />
															<argument exp='2' />
															<argument exp='0' />
															<argument exp='0' />
														</command>
														<command class_type='comment' title='' comment='Start timer.
Each game has a limited time.' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
														<command class_type='interrupt' title='Interrupt' cmdcolor='17151' cmdcolor_sec='355583' enable='1' name='TMR0' call='Clock' >
															<settings timer='1' prescale='1024' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
																<option value='5' />
																<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='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
															<exp exp='flag_loop = 0' />
															<exp exp='secs = 0' />
															<exp exp='coin_state = 0' />
															<exp exp='flag_win = 0' />
														</command>
														<command class_type='calculation' title='Calculation' disable='1' cmdcolor='16760919' cmdcolor_sec='16760832' >
															<exp exp='balls_total = 150' />
														</command>
														<command class_type='calculation' title='Testing with 50 balls only!' cmdcolor='16760919' cmdcolor_sec='16760832' >
															<exp exp='balls_total = 50' />
														</command>
														<command class_type='loop' title='Loop' cmdcolor='12615680' cmdcolor_sec='15376912' type='1' exp='flag_loop = 1' >
															<flowline >
																<command class_type='comment' title='' comment='Game based on two parameters: time limit and balls number.
If time is out -&gt; game over.
If balls out first -&gt; game over.' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
																<command class_type='decision' title='Default game = 3 mins or 60 secs   x 3 = 180' cmdcolor='12615680' cmdcolor_sec='15376912' exp='secs &gt;= 120' swap='0' >
																	<flowline >
																		<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																			<argument exp='&quot;Game over         &quot;' />
																			<argument exp='2' />
																			<argument exp='2' />
																			<argument exp='0' />
																			<argument exp='0' />
																		</command>
																		<command class_type='decision' title='If time out and user won some balls' cmdcolor='12615680' cmdcolor_sec='15376912' exp='count_win &gt; 0' swap='0' >
																			<flowline >
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																					<argument exp='&quot;Balls in game&quot;' />
																					<argument exp='2' />
																					<argument exp='42' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																					<argument exp='&quot;                   &quot;' />
																					<argument exp='2' />
																					<argument exp='32' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='PrintNumber' >
																					<argument exp='balls_total' />
																					<argument exp='90' />
																					<argument exp='42' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																					<argument exp='&quot;You won&quot;' />
																					<argument exp='2' />
																					<argument exp='12' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='PrintNumber' >
																					<argument exp='count_win' />
																					<argument exp='55' />
																					<argument exp='12' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																					<argument exp='&quot;Save and play more?&quot;' />
																					<argument exp='2' />
																					<argument exp='22' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='comment' title='' comment='Add here the code to save results into EEPROM,
and play more games logics...' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
																				<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																					<exp exp='count_win = 0' />
																				</command>
																				<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='1' type='1' />
																			</flowline>
																			<flowline >
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																					<argument exp='&quot;Time out          &quot;' />
																					<argument exp='2' />
																					<argument exp='12' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																			</flowline>
																		</command>
																		<command class_type='comment' title='' comment='End of game, time out' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
																		<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='2' type='2' />
																		<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																			<exp exp='flag_loop = 1' />
																		</command>
																	</flowline>
																	<flowline />
																</command>
																<command class_type='comment' title='' comment='Constantly check the ball sensor,
count the balls' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
																<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																	<exp exp='ball_state = 0' />
																</command>
																<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SwBallOut' macro='ReadState' >
																	<return exp='ball_state' />
																</command>
																<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='ball_state = 1' swap='0' >
																	<flowline >
																		<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																			<exp exp='count_balls = count_balls + 1' />
																		</command>
																		<command class_type='call' title='End-switch 1' disable='1' cmdcolor='1879295' cmdcolor_sec='5751039' component='SwWinLeft' macro='ReadState' >
																			<return exp='flag_win' />
																		</command>
																		<command class_type='call' title='End-switch 1' disable='1' cmdcolor='1879295' cmdcolor_sec='5751039' component='SwWinMiddle' macro='ReadState' >
																			<return exp='flag_win' />
																		</command>
																		<command class_type='call' title='End-switch 1' cmdcolor='1879295' cmdcolor_sec='5751039' component='SwWinRight' macro='ReadState' >
																			<return exp='flag_win' />
																		</command>
																		<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='flag_win = 1' swap='0' >
																			<flowline >
																				<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																					<exp exp='balls_total = balls_total + 1' />
																				</command>
																				<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																					<exp exp='secs = secs - 2' />
																				</command>
																				<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																					<exp exp='count_win = count_win + 1' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																					<argument exp='&quot;Win N:&quot;' />
																					<argument exp='2' />
																					<argument exp='32' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='PrintNumber' >
																					<argument exp='count_win' />
																					<argument exp='42' />
																					<argument exp='32' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='300' type='1' />
																				<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																					<exp exp='flag_win = 0' />
																				</command>
																			</flowline>
																			<flowline >
																				<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																					<exp exp='balls_total = balls_total - 1' />
																				</command>
																			</flowline>
																		</command>
																		<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='balls_total = 0' swap='0' >
																			<flowline >
																				<command class_type='comment' title='' comment='End of game, no more balls' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
																				<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																					<exp exp='count_balls = 0' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																					<argument exp='&quot;Game over         &quot;' />
																					<argument exp='2' />
																					<argument exp='2' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																					<argument exp='&quot;No more balls        &quot;' />
																					<argument exp='2' />
																					<argument exp='12' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='3' type='2' />
																				<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																					<exp exp='flag_loop = 1' />
																				</command>
																			</flowline>
																			<flowline >
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																					<argument exp='&quot;Balls up:&quot;' />
																					<argument exp='2' />
																					<argument exp='52' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='PrintNumber' >
																					<argument exp='count_balls' />
																					<argument exp='55' />
																					<argument exp='52' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																					<argument exp='&quot;Balls in game&quot;' />
																					<argument exp='2' />
																					<argument exp='42' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='PrintNumber' >
																					<argument exp='balls_total' />
																					<argument exp='90' />
																					<argument exp='42' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																				<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='300' type='1' />
																				<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																					<argument exp='&quot;      &quot;' />
																					<argument exp='90' />
																					<argument exp='42' />
																					<argument exp='0' />
																					<argument exp='0' />
																				</command>
																			</flowline>
																		</command>
																		<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='PrintNumber' >
																			<argument exp='secs' />
																			<argument exp='80' />
																			<argument exp='52' />
																			<argument exp='0' />
																			<argument exp='0' />
																		</command>
																		<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
																			<argument exp='&quot;s&quot;' />
																			<argument exp='105' />
																			<argument exp='52' />
																			<argument exp='0' />
																			<argument exp='0' />
																		</command>
																	</flowline>
																	<flowline >
																		<command class_type='comment' title='' comment='Error
or
player
is not
active' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
																	</flowline>
																</command>
															</flowline>
														</command>
														<command class_type='comment' title='' comment='End-switch is connected meaning - ball is thrown up' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
														<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
															<exp exp='count_balls = 0' />
															<exp exp='count_win = 0' />
														</command>
														<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='ClearDisplay' />
														<command class_type='interrupt' title='Interrupt' cmdcolor='17151' cmdcolor_sec='355583' enable='0' name='TMR0' >
															<settings timer='1' prescale='256' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
																<option value='0' />
																<option value='0' />
																<option value='8' />
																<option value='-1' />
																<option value='-1' />
																<option value='-1' />
																<option value='-1' />
																<option value='-1' />
															</settings>
														</command>
													</flowline>
													<flowline >
														<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
															<argument exp='&quot;Start the game&quot;' />
															<argument exp='2' />
															<argument exp='2' />
															<argument exp='0' />
															<argument exp='0' />
														</command>
													</flowline>
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='LedB5' macro='TurnOff' />
										<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
											<argument exp='&quot;Insert coin/token &quot;' />
											<argument exp='2' />
											<argument exp='2' />
											<argument exp='0' />
											<argument exp='0' />
										</command>
										<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='1' type='2' />
									</flowline>
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='InitSsd1306_i2c' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Initialise' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='ClearDisplay' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='Print' >
							<argument exp='&quot;ssd1306_OK&quot;' />
							<argument exp='2' />
							<argument exp='2' />
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='2' type='2' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='SSD1306_i2c1' macro='ClearDisplay' />
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='LedB5' x='100' y='-80' z='-3.85' xsz='3.20513' ysz='3.20513' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTB.5' />
					<value target='polarity' data='001' />
					<value target='on_color' data='8453975' />
					<value target='show_label' data='002' />
					<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='text' codename='label2' x='-98' y='56' z='1.05' xsz='8' ysz='8' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='0' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='A0-Left' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='LedWin' x='124' y='80' z='-3.85' xsz='3.20513' ysz='3.20513' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTB.2' />
					<value target='polarity' data='001' />
					<value target='on_color' data='8404224' />
					<value target='show_label' data='002' />
					<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='a31b1f0a-4221-490d-ae25-027868688f0b' vmin='0' vmaj='1' codename='SwWinLeft' x='-100' y='87.75' z='0' xsz='3' ysz='2.58065' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTD.7' />
					<value target='polarity' data='000' />
					<value target='debounce' data='11' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='a31b1f0a-4221-490d-ae25-027868688f0b' vmin='0' vmaj='1' codename='SwWinMiddle' x='-54.8206' y='87.75' z='0' xsz='3' ysz='2.58065' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTB.0' />
					<value target='polarity' data='000' />
					<value target='debounce' data='11' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='a31b1f0a-4221-490d-ae25-027868688f0b' vmin='0' vmaj='1' codename='SwWinRight' x='50.3588' y='87.75' z='0' xsz='3' ysz='2.58065' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTB.1' />
					<value target='polarity' data='000' />
					<value target='debounce' data='11' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9a971ee1-28e0-4e47-9c09-71268383fc75' vmin='0' vmaj='1' codename='shape_label1' x='56.9681' y='134' z='1' xsz='1.716' ysz='2.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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='8388626' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='Win end-switches' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label3' x='-58' y='56' z='1.05' xsz='8' ysz='8' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='0' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='A1-Central' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label4' x='82' y='56' z='1.05' xsz='8' ysz='8' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='0' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='A2-Right' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='a31b1f0a-4221-490d-ae25-027868688f0b' vmin='0' vmaj='1' codename='SwBallOut' x='-4.46181' y='-2.25' z='0' xsz='3' ysz='2.58065' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTD.5' />
					<value target='polarity' data='000' />
					<value target='debounce' data='11' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9a971ee1-28e0-4e47-9c09-71268383fc75' vmin='0' vmaj='1' codename='shape_label2' x='-0.90282' y='34' z='0.75' xsz='1.716' ysz='2.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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='8388626' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='Ball out' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label6' x='-8' y='-34' z='1.05' xsz='8' ysz='8' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='0' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='A3-Shot' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='f6ab6074-68ba-4cd4-9274-f973102f8518' vmin='9' vmaj='1' codename='SSD1306_i2c1' x='7.32193' y='227.008' z='0' xsz='6.92765' ysz='8.56164' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pixel_height' data='64' />
					<value target='pixel_width' data='128' />
					<value target='Interlaced' data='1' />
					<value target='monochrome' data='1' />
					<value target='foreground_colour' data='16777215' />
					<value target='background_colour' data='0' />
					<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='Address' data='120' />
					<value target='cal_i2c1::CHANNEL' data='001' />
					<value target='cal_i2c1::BAUD_LIST' data='001' />
					<value target='cal_i2c1::BAUD' data='100000' />
					<value target='cal_i2c1::StopDel' data='0' />
					<value target='cal_i2c1::SDA' data='$PORTC.4' />
					<value target='cal_i2c1::SDAPins' data='000' />
					<value target='cal_i2c1::SCL' data='$PORTC.5' />
					<value target='cal_i2c1::SCLPins' data='000' />
					<value target='DisplayMethod' data='000' />
					<value target='SimComms' data='0' />
					<value target='cal_i2c1::ConsoleData' data='0' />
					<value target='cal_i2c1::ScopeTraces' data='0' />
					<value target='cal_i2c1::Injector' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='a31b1f0a-4221-490d-ae25-027868688f0b' vmin='0' vmaj='1' codename='SwCoin' x='100.718' y='-2.25' z='0' xsz='3' ysz='2.58065' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTD.4' />
					<value target='polarity' data='000' />
					<value target='debounce' data='11' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9a971ee1-28e0-4e47-9c09-71268383fc75' vmin='0' vmaj='1' codename='shape_label4' x='101.226' y='34' z='0.75' xsz='1.716' ysz='2.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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='8388626' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='Insert coin' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9a971ee1-28e0-4e47-9c09-71268383fc75' vmin='0' vmaj='1' codename='shape_label5' x='29.0972' y='154' z='0.75' xsz='1.716' ysz='2.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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='8388626' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='SSD1306 - i2c - C4,C5' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9a971ee1-28e0-4e47-9c09-71268383fc75' vmin='0' vmaj='1' codename='shape_label6' x='103.355' y='-36' z='0.75' xsz='1.716' ysz='2.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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='8388626' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='D4' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9a971ee1-28e0-4e47-9c09-71268383fc75' vmin='0' vmaj='1' codename='shape_label7' x='17.6161' y='359' z='0.25' xsz='2.42334' ysz='3.75' 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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='8388626' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='Ard Mega Pin-Ball machine' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9a971ee1-28e0-4e47-9c09-71268383fc75' vmin='0' vmaj='1' codename='shape_label3' x='49.0972' y='114' z='0.75' xsz='1.716' ysz='2.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='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='8388626' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='Test This One' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='8421376' img='' style='0' />
		<camera xe='4.9258' ye='64.9345' ze='380.857' xt='4.9258' yt='64.9345' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='1' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7884836' img='' style='0' size='25' />
		<camera xe='-0.708839' ye='94.4004' ze='878.036' xt='-0.430467' yt='6.59519' zt='4.83712' xquat='0.0500886' yquat='7.93802e-05' zquat='-0.00158328' wquat='0.998744' />
		<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---------------------wUAAAAYAAAADwMAAGMDAAA' zoom='75' scrollx='1337' scrolly='2354' flags='0' />
		<view type='0' name='Clock' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAADwMAAGMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Coin_detected' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAADwMAAGMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Credits' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAADwMAAGMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='InitPorts' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAADwMAAGMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='InitSsd1306_i2c' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAADwMAAGMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Coin_state' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAADwMAAGMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
