<root>
<document schema='101' license='1,eastleighcollege,V2JM35' title='' description='' target='PIC.16F.16F1937' >
	<config data='!0,fe2!10,1eff%0,2%3,0%5,1%6,1%7,1%8,1%9,3%b,1%c,0%d,0%10,3%14,3%18,0%19,1%1a,1%1c,1%1d,0' clkspd='19660800' simspd='1' usewdt='0' constif='0' />
	<plugins >
		<dll_dbg_icd enabled='0' >
			<data name='debug' value='1' />
			<data name='userpins' value='0' />
			<data name='speed' value='1000' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='1' />
			<data name='clkbit' value='6' />
			<data name='dataport' value='1' />
			<data name='databit' value='7' />
			<data name='ghostype' value='0' />
			<data name='monitor' value='1' />
			<data name='ictloop' value='1' />
			<data name='ictrate' value='1000' />
			<data name='ictmask' value='-1' />
			<data name='anlpres' value='19' />
			<data name='digmask1' value='-1' />
			<data name='digmask2' value='-1' />
		</dll_dbg_icd>
		<dll_models enabled='1' />
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='main_mode' />
		<watch expr='LCD_mode' />
	</debug>
	<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' />
		</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' 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' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='count' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='timer_0_ten_millisecond_counter' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='one_second_timer' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAIN_READY' type='s16' description='' isconst='1' isinit='1' usrinit='2' setinit='2' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='CANCEL_KEY' type='s16' description='' isconst='1' isinit='1' usrinit='128' setinit='0x80' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LED_state' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LCD_CANCELLED' type='s16' description='' isconst='1' isinit='1' usrinit='5' setinit='5' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAIN_DONE' type='s16' description='' isconst='1' isinit='1' usrinit='4' setinit='4' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LED_STATE_ON' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='main_mode' type='u8' description='' isconst='0' isinit='1' usrinit='1' setinit='MAIN_WELCOME' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LCD_SET_TIME' type='s16' description='' isconst='1' isinit='1' usrinit='2' setinit='2' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LED_COOKING' type='s16' description='' isconst='1' isinit='1' usrinit='2' setinit='2' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MIN_COOKING_TIME' type='s16' description='' isconst='1' isinit='1' usrinit='120' setinit='120' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MINUTE_LESS_1_KEY' type='s16' description='' isconst='1' isinit='1' usrinit='8' setinit='0x08' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAX_COOKING_TIME' type='s16' description='' isconst='1' isinit='1' usrinit='360' setinit='360' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='piezo_state' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='welcome_timer' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='piezo_enable' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='egg_time_remaining' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LCD_WELCOME' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LED_timer' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LCD_DONE' type='s16' description='' isconst='1' isinit='1' usrinit='4' setinit='4' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LCD_mode' type='u8' description='' isconst='0' isinit='1' usrinit='1' setinit='LCD_WELCOME' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LED_OFF' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAIN_WELCOME' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='piezo_enable_history' type='b1' description='0' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='key_history' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LCD_COOKING' type='s16' description='' isconst='1' isinit='1' usrinit='3' setinit='3' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='egg_time_displayed' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SECONDS_ADD_10_KEY' type='s16' description='' isconst='1' isinit='1' usrinit='4' setinit='0x04' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAIN_CANCELLED' type='s16' description='' isconst='1' isinit='1' usrinit='5' setinit='5' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LCD_mode_history' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='egg_timer_enable' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAIN_OVERCOOKED' type='s16' description='' isconst='1' isinit='1' usrinit='6' setinit='6' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LCD_OVERCOOKED' type='s16' description='' isconst='1' isinit='1' usrinit='6' setinit='6' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SECONDS_LESS_10_KEY' type='s16' description='' isconst='1' isinit='1' usrinit='2' setinit='0x02' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MUNUTE_ADD_1_KEY' type='s16' description='' isconst='1' isinit='1' usrinit='16' setinit='0x10' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAIN_COOKING' type='s16' description='' isconst='1' isinit='1' usrinit='3' setinit='3' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='QUICK_START_KEY' type='s16' description='' isconst='1' isinit='1' usrinit='64' setinit='0x40' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LED_DONE' type='s16' description='' isconst='1' isinit='1' usrinit='4' setinit='4' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LED_OVERCOOKED' type='s16' description='' isconst='1' isinit='1' usrinit='5' setinit='5' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='IDEAL_COOKING_TIME' type='s16' description='' isconst='1' isinit='1' usrinit='210' setinit='210' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='START_KEY' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='0x01' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LED_mode' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LED_STATE_OFF' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='key_actioned' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='main_ready' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='debounced_keys' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='scratchpad' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='key_actioned = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.scratchpad = egg_time_remaining' />
								</command>
								<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.debounced_keys' >
									<case >
										<flowline />
									</case>
									<case exp='QUICK_START_KEY' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='main_mode = MAIN_COOKING' />
												<exp exp='LCD_mode = LCD_COOKING' />
												<exp exp='LED_mode = LED_COOKING' />
												<exp exp='piezo_enable = 0' />
												<exp exp='.scratchpad = IDEAL_COOKING_TIME' />
												<exp exp='egg_timer_enable = 1' />
												<exp exp='key_actioned = 1' />
											</command>
										</flowline>
									</case>
									<case exp='SECONDS_LESS_10_KEY' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='.scratchpad = egg_time_remaining - 10' />
												<exp exp='key_actioned = 1' />
											</command>
										</flowline>
									</case>
									<case exp='SECONDS_ADD_10_KEY' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='.scratchpad = egg_time_remaining + 10' />
												<exp exp='key_actioned = 1' />
											</command>
										</flowline>
									</case>
									<case exp='MINUTE_LESS_1_KEY' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='.scratchpad = egg_time_remaining - 60' />
												<exp exp='key_actioned = 1' />
											</command>
										</flowline>
									</case>
									<case exp='MUNUTE_ADD_1_KEY' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='.scratchpad = egg_time_remaining + 60' />
												<exp exp='key_actioned = 1' />
											</command>
										</flowline>
									</case>
									<case exp='START_KEY' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='main_mode = MAIN_COOKING' />
												<exp exp='LCD_mode = LCD_COOKING' />
												<exp exp='LED_mode = LED_COOKING' />
												<exp exp='piezo_enable = 0' />
												<exp exp='egg_timer_enable = 1' />
												<exp exp='key_actioned = 1' />
											</command>
										</flowline>
									</case>
									<case exp='CANCEL_KEY' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='.scratchpad = IDEAL_COOKING_TIME' />
												<exp exp='key_actioned = 1' />
											</command>
										</flowline>
									</case>
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(.scratchpad &gt;= MIN_COOKING_TIME) &amp; (.scratchpad &lt;= MAX_COOKING_TIME)' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='egg_time_remaining = .scratchpad' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='main_done' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='debounced_keys' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='key_actioned = 0' swap='0' >
							<flowline >
								<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.debounced_keys' >
									<case >
										<flowline />
									</case>
									<case exp='CANCEL_KEY' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='main_mode = MAIN_READY' />
												<exp exp='LCD_mode = LCD_SET_TIME' />
												<exp exp='LED_mode = LED_OFF' />
												<exp exp='egg_time_displayed = 0' />
												<exp exp='egg_time_remaining = IDEAL_COOKING_TIME' />
												<exp exp='egg_timer_enable = 0' />
												<exp exp='piezo_enable = 0' />
												<exp exp='key_actioned = 1' />
											</command>
										</flowline>
									</case>
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Timer_0_ISR' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='Timer 0 interrupt rate = 300Hz
so 3 x Timer 0 interrupts = 100Hz
giving us a 10ms system clock tick' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='timer_0_ten_millisecond_counter != 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='timer_0_ten_millisecond_counter = timer_0_ten_millisecond_counter - 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='timer 0 10ms counter has reached zero
so reload it for another 10ms tick

everything below this point
is executed once every 10ms' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='timer_0_ten_millisecond_counter = 2' />
									<exp exp='// 300Hz / 3 = 100Hz =&gt; 10ms' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='welcome_timer &gt; 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='welcome_timer = welcome_timer - 1' />
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='stop decrementing
welcome_timer when
it reaches zero' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
									</flowline>
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LED_timer &gt; 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='LED_timer = LED_timer - 1' />
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='stop decrementing
LED_timer when
it reaches zero' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
									</flowline>
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='egg_timer_enable = 1' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='one_second_timer != 0' swap='0' >
											<flowline >
												<command class_type='calculation' title='' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='one_second_timer = one_second_timer - 1' />
												</command>
											</flowline>
											<flowline >
												<command class_type='comment' title='' comment='one_second_timer has reached zero
so reload it with another
1 second tick

everything below this point
is executed once every second' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='one_second_timer = 99' />
													<exp exp='// 100 x 10ms = one second' />
												</command>
												<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='egg_time_remaining != 0' swap='0' >
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='egg_time_remaining = egg_time_remaining - 1' />
														</command>
													</flowline>
													<flowline >
														<command class_type='comment' title='' comment='stop decrementing
egg_time_remaining when
it reaches zero' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
													</flowline>
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LCD_task' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='debounced_keys' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='LCD_egg_time_minutes' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='LCD_egg_time_seconds_tens' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='LCD_egg_time_seconds_units' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='LCD_egg_time_local_copy' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='LCD_remainder' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LCD_mode' >
							<case >
								<flowline />
							</case>
							<case exp='LCD_WELCOME' >
								<flowline >
									<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LCD_mode != LCD_mode_history' swap='0' >
										<flowline >
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Clear' />
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Cursor' >
												<argument exp='0' />
												<argument exp='0' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintString' >
												<argument exp='&quot;WELCOME&quot;' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Cursor' >
												<argument exp='0' />
												<argument exp='1' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintString' >
												<argument exp='&quot;MESSAGE&quot;' />
											</command>
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='LCD_mode_history = LCD_mode' />
											</command>
										</flowline>
										<flowline />
									</command>
								</flowline>
							</case>
							<case exp='LCD_SET_TIME' >
								<flowline >
									<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(LCD_mode != LCD_mode_history) | (egg_time_remaining != egg_time_displayed)' swap='0' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='.LCD_egg_time_local_copy = egg_time_remaining' />
												<exp exp='.LCD_egg_time_minutes = .LCD_egg_time_local_copy / 60' />
												<exp exp='.LCD_remainder = .LCD_egg_time_local_copy % 60' />
												<exp exp='.LCD_egg_time_seconds_tens = .LCD_remainder / 10' />
												<exp exp='.LCD_egg_time_seconds_units = .LCD_remainder % 10' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Cursor' >
												<argument exp='0' />
												<argument exp='0' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintString' >
												<argument exp='&quot;SET TIME        &quot;' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Cursor' >
												<argument exp='0' />
												<argument exp='1' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintAscii' >
												<argument exp='&apos; &apos;' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintNumber' >
												<argument exp='.LCD_egg_time_minutes' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintAscii' >
												<argument exp='&apos;:&apos;' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintNumber' >
												<argument exp='.LCD_egg_time_seconds_tens' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintNumber' >
												<argument exp='.LCD_egg_time_seconds_units' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintString' >
												<argument exp='&quot;    &quot;' />
											</command>
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='egg_time_displayed = .LCD_egg_time_local_copy' />
												<exp exp='LCD_mode_history = LCD_mode' />
											</command>
										</flowline>
										<flowline />
									</command>
								</flowline>
							</case>
							<case exp='LCD_COOKING' >
								<flowline >
									<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='egg_time_remaining != egg_time_displayed' swap='0' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='.LCD_egg_time_local_copy = egg_time_remaining' />
												<exp exp='.LCD_egg_time_minutes = .LCD_egg_time_local_copy / 60' />
												<exp exp='.LCD_remainder = .LCD_egg_time_local_copy % 60' />
												<exp exp='.LCD_egg_time_seconds_tens = .LCD_remainder / 10' />
												<exp exp='.LCD_egg_time_seconds_units = .LCD_remainder % 10' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Cursor' >
												<argument exp='0' />
												<argument exp='0' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintString' >
												<argument exp='&quot;COOKING         &quot;' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Cursor' >
												<argument exp='0' />
												<argument exp='1' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintAscii' >
												<argument exp='&apos; &apos;' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintNumber' >
												<argument exp='.LCD_egg_time_minutes' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintAscii' >
												<argument exp='&apos;:&apos;' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintNumber' >
												<argument exp='.LCD_egg_time_seconds_tens' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintNumber' >
												<argument exp='.LCD_egg_time_seconds_units' />
											</command>
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='egg_time_displayed = .LCD_egg_time_local_copy' />
											</command>
										</flowline>
										<flowline />
									</command>
								</flowline>
							</case>
							<case exp='LCD_DONE' >
								<flowline >
									<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LCD_mode != LCD_mode_history' swap='0' >
										<flowline >
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Clear' />
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Cursor' >
												<argument exp='0' />
												<argument exp='0' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintString' >
												<argument exp='&quot;DONE            &quot;' />
											</command>
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='LCD_mode_history = LCD_mode' />
											</command>
										</flowline>
										<flowline />
									</command>
								</flowline>
							</case>
							<case exp='LCD_CANCELLED' >
								<flowline >
									<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LCD_mode != LCD_mode_history' swap='0' >
										<flowline >
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Clear' />
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Cursor' >
												<argument exp='0' />
												<argument exp='0' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintString' >
												<argument exp='&quot;CANCELLED       &quot;' />
											</command>
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='LCD_mode_history = LCD_mode' />
											</command>
										</flowline>
										<flowline />
									</command>
								</flowline>
							</case>
							<case exp='LCD_OVERCOOKED' >
								<flowline >
									<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LCD_mode != LCD_mode_history' swap='0' >
										<flowline >
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Clear' />
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Cursor' >
												<argument exp='0' />
												<argument exp='0' />
											</command>
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='PrintString' >
												<argument exp='&quot;OVERCOOKED      &quot;' />
											</command>
											<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
												<exp exp='LCD_mode_history = LCD_mode' />
											</command>
										</flowline>
										<flowline />
									</command>
								</flowline>
							</case>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='main_welcome' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='debounced_keys' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='key_actioned = 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(welcome_timer = 0) | (.debounced_keys != 0)' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='welcome_timer = 0' />
											<exp exp='main_mode = MAIN_READY' />
											<exp exp='LCD_mode = LCD_SET_TIME' />
											<exp exp='LED_mode = LED_OFF' />
											<exp exp='piezo_enable = 0' />
											<exp exp='egg_time_remaining = IDEAL_COOKING_TIME' />
											<exp exp='egg_time_displayed = 0' />
											<exp exp='egg_timer_enable = 0' />
											<exp exp='key_actioned = 1' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Timer_2_ISR' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='When Timer 2 Interrupt is enabled,
this macro toggles the states of
port pins C0 and C1 at 2.4kHz.
Connect a Piezo sounder between
the port pins.' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='piezo_state = 1' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='piezo_state = 0' />
								</command>
								<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='1' exp='1' />
								<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='2' exp='0' />
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='piezo_state = 1' />
								</command>
								<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='1' exp='0' />
								<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='2' exp='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='main_cancelled' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='debounced_keys' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='key_actioned = 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.debounced_keys != 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='main_mode = MAIN_READY' />
											<exp exp='LCD_mode = LCD_SET_TIME' />
											<exp exp='LED_mode = LED_OFF' />
											<exp exp='egg_time_displayed = 0' />
											<exp exp='egg_time_remaining = IDEAL_COOKING_TIME' />
											<exp exp='egg_timer_enable = 0' />
											<exp exp='piezo_enable = 0' />
											<exp exp='key_actioned = 1' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='key_task' description='' >
						<return name='Return' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='a_keys' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='b_keys' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='key_poll' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='4' />
						</local>
						<local name='poll_count' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='This macro reads the state of the keys connected to ports A and B.
If the state of the keys has changed:
   read the ports 4 times with a delay between readings
   if the 4 readings are the same, the keys have stopped bouncing
   and the macro returns the new &quot;debounced&quot; state of the keys' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='input' title='Input' cmdcolor='3610239' cmdcolor_sec='3610239' mode='2' port='1048576' mask='63' exp='.a_keys' />
						<command class_type='input' title='Input' cmdcolor='3610239' cmdcolor_sec='3610239' mode='2' port='1048577' mask='192' exp='.b_keys' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.key_poll[0] = .a_keys + (.b_keys &amp; 0xC0)' />
							<exp exp='.poll_count = 1' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.key_poll[0] != key_history' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='The keys have changed relative to the key_history, meaning:
- a key has been pressed
- or a key has been released' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='.poll_count = 4' >
									<flowline >
										<command class_type='comment' title='' comment='read the ports 4 times
with a delay between
each reading' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
										<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='10' type='1' />
										<command class_type='input' title='Input' cmdcolor='3610239' cmdcolor_sec='3610239' mode='2' port='1048576' mask='63' exp='.a_keys' />
										<command class_type='input' title='Input' cmdcolor='3610239' cmdcolor_sec='3610239' mode='2' port='1048577' mask='192' exp='.b_keys' />
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.key_poll[.poll_count] = .a_keys + (.b_keys &amp; 0xC0)' />
											<exp exp='.poll_count = .poll_count + 1' />
										</command>
									</flowline>
								</command>
								<command class_type='comment' title='' comment='if the 4 readings of the ports are the same
the keys have stopped bouncing
and we can update the key_history
and return to the calling function
with the stable state of the keys' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(.key_poll[0] = .key_poll[1]) &amp; (.key_poll[0] = .key_poll[2]) = (.key_poll[0] = .key_poll[3])' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='Only update key_history
when we have read the
switches 4 times and
all 4 readings were
the same' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='key_history = .key_poll[0]' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.Return = key_history' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='main_overcooked' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='debounced_keys' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='key_actioned = 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.debounced_keys != 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='main_mode = MAIN_READY' />
											<exp exp='LCD_mode = LCD_SET_TIME' />
											<exp exp='LED_mode = LED_OFF' />
											<exp exp='piezo_enable = 0' />
											<exp exp='key_actioned = 1' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='main_cooking' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='debounced_keys' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='egg_time_remaining = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='main_mode = MAIN_DONE' />
									<exp exp='LCD_mode = LCD_DONE' />
									<exp exp='LED_mode = LED_DONE' />
									<exp exp='egg_timer_enable = 0' />
									<exp exp='piezo_enable = 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='key_actioned = 0' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(.debounced_keys &amp; CANCEL_KEY) = CANCEL_KEY' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='main_mode = MAIN_CANCELLED' />
													<exp exp='LCD_mode = LCD_CANCELLED' />
													<exp exp='LED_mode = LED_OFF' />
													<exp exp='piezo_enable = 0' />
													<exp exp='egg_timer_enable = 0' />
													<exp exp='key_actioned = 1' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='LED_task' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LED_mode' >
							<case >
								<flowline />
							</case>
							<case exp='LED_OFF' >
								<flowline >
									<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
										<exp exp='LED_timer = 0' />
									</command>
									<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='128' exp='0' />
								</flowline>
							</case>
							<case exp='LED_COOKING' >
								<flowline >
									<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LED_state' >
										<case >
											<flowline />
										</case>
										<case exp='LED_STATE_OFF' >
											<flowline >
												<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LED_timer = 0' swap='0' >
													<flowline >
														<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='128' exp='1' />
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='LED_timer = 10' />
															<exp exp='LED_state = LED_STATE_ON' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
										</case>
										<case exp='LED_STATE_ON' >
											<flowline >
												<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LED_timer = 0' swap='0' >
													<flowline >
														<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='128' exp='0' />
														<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='egg_time_remaining &lt; 30' swap='0' >
															<flowline >
																<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
																	<exp exp='LED_timer = 10' />
																</command>
															</flowline>
															<flowline >
																<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
																	<exp exp='LED_timer = 50' />
																</command>
															</flowline>
														</command>
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='LED_state = LED_STATE_OFF' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
										</case>
									</command>
								</flowline>
							</case>
							<case exp='LED_DONE' >
								<flowline >
									<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
										<exp exp='LED_timer = 0' />
									</command>
									<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='128' exp='1' />
								</flowline>
							</case>
							<case exp='LED_OVERCOOKED' >
								<flowline >
									<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LED_state' >
										<case >
											<flowline />
										</case>
										<case exp='LED_STATE_OFF' >
											<flowline >
												<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LED_timer = 0' swap='0' >
													<flowline >
														<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='128' exp='1' />
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='LED_timer = 50' />
															<exp exp='LED_state = LED_STATE_ON' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
										</case>
										<case exp='LED_STATE_ON' >
											<flowline >
												<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='LED_timer = 0' swap='0' >
													<flowline >
														<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='128' exp='0' />
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='LED_timer = 10' />
															<exp exp='LED_state = LED_STATE_OFF' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
										</case>
									</command>
								</flowline>
							</case>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='debounced_keys' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='egg_time_remaining = IDEAL_COOKING_TIME' />
							<exp exp='egg_timer_enable = 0' />
							<exp exp='piezo_enable = 0' />
							<exp exp='piezo_enable_history = 0' />
							<exp exp='piezo_state = 0' />
							<exp exp='key_history = 0' />
							<exp exp='LCD_mode_history = 0' />
							<exp exp='LCD_mode = LCD_WELCOME' />
							<exp exp='welcome_timer = 500' />
							<exp exp='main_mode = MAIN_WELCOME' />
							<exp exp='key_actioned = 0' />
						</command>
						<command class_type='interrupt' title='Interrupt' cmdcolor='3610239' cmdcolor_sec='3610239' enable='1' name='TMR0' call='Timer_0_ISR' >
							<settings timer='1' prescale='64' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='1' />
								<option value='0' />
								<option value='6' />
								<option value='-1' />
								<option value='0' />
								<option value='0' />
								<option value='0' />
								<option value='0' />
							</settings>
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='ComboBoard1' macro='Start' />
						<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='key_task' cmdcolor='1975743' cmdcolor_sec='1975743' macro='key_task' >
									<return exp='.debounced_keys' />
								</command>
								<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='3568629' cmdcolor_sec='3568629' exp='main_mode' >
									<case >
										<flowline />
									</case>
									<case exp='MAIN_WELCOME' >
										<flowline >
											<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='main_welcome' >
												<argument exp='.debounced_keys' />
											</command>
										</flowline>
									</case>
									<case exp='MAIN_READY' >
										<flowline >
											<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='main_ready' >
												<argument exp='.debounced_keys' />
											</command>
										</flowline>
									</case>
									<case exp='MAIN_COOKING' >
										<flowline >
											<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='main_cooking' >
												<argument exp='.debounced_keys' />
											</command>
										</flowline>
									</case>
									<case exp='MAIN_DONE' >
										<flowline >
											<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='main_done' >
												<argument exp='.debounced_keys' />
											</command>
										</flowline>
									</case>
									<case exp='MAIN_CANCELLED' >
										<flowline >
											<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='main_cancelled' >
												<argument exp='.debounced_keys' />
											</command>
										</flowline>
									</case>
									<case exp='MAIN_OVERCOOKED' >
										<flowline >
											<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='main_overcooked' >
												<argument exp='.debounced_keys' />
											</command>
										</flowline>
									</case>
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(key_actioned = 1) &amp; (.debounced_keys = 0)' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='wait for key release
before actioning
another keypress' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='key_actioned = 0' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='LCD_task' >
									<argument exp='.debounced_keys' />
								</command>
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='LED_task' />
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='piezo_enable != piezo_enable_history' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='piezo_enable = 1' swap='0' >
											<flowline >
												<command class_type='interrupt' title='Interrupt' cmdcolor='3610239' cmdcolor_sec='3610239' enable='1' name='TMR2' call='Timer_2_ISR' >
													<settings timer='1' prescale='4' postscale='2' rollover='256' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
														<option value='1' />
														<option value='1' />
														<option value='256' />
														<option value='-1' />
														<option value='0' />
														<option value='0' />
														<option value='0' />
														<option value='0' />
													</settings>
												</command>
											</flowline>
											<flowline >
												<command class_type='interrupt' title='Interrupt' cmdcolor='3610239' cmdcolor_sec='3610239' enable='0' name='TMR2' >
													<settings timer='1' prescale='4' postscale='2' rollover='256' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
														<option value='1' />
														<option value='1' />
														<option value='256' />
														<option value='-1' />
														<option value='0' />
														<option value='0' />
														<option value='0' />
														<option value='0' />
													</settings>
												</command>
											</flowline>
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='piezo_enable_history = piezo_enable' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='63177601-e8e2-4330-89d3-a4c5a7e228f5' vmin='1' vmaj='1' codename='led_array_pcb1' x='-40' y='40' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='count' data='8' />
					<value target='port' data='000' />
					<value target='PortByte' data='$PORTC0' />
					<value target='pin0' data='$PORTC0.0' />
					<value target='pin1' data='$PORTC0.1' />
					<value target='pin2' data='$PORTC0.2' />
					<value target='pin3' data='$PORTC0.3' />
					<value target='pin4' data='$PORTC0.4' />
					<value target='pin5' data='$PORTC0.5' />
					<value target='pin6' data='$PORTC0.6' />
					<value target='pin7' data='$PORTC0.7' />
					<value target='polarity' data='001' />
					<value target='full_port' data='$PORTC0' />
					<value target='align' data='000' />
					<value target='spacing' data='12.000000' />
					<value target='reverse' data='0' />
					<value target='label_position' data='003' />
					<value target='color_led0' data='65280' />
					<value target='label_color' data='16777215' />
					<value target='bitmask' data='255' />
					<value target='inv_bitmask' data='-256' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7ade85db-6ca2-48bf-b19c-8148ebda497b' vmin='0' vmaj='1' codename='dashboard_text1' 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' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='PosX' data='0.000000' />
					<value target='PosY' data='0.000000' />
					<value target='PosZ' data='0.000000' />
					<value target='ScaleX' data='1.000000' />
					<value target='ScaleY' data='1.000000' />
					<value target='ScaleZ' data='1.000000' />
					<value target='SizeX' data='36.000000' />
					<value target='SizeY' data='36.000000' />
					<value target='SizeZ' data='2.000000' />
					<value target='ChildPosX' data='0.000000' />
					<value target='ChildPosY' data='0.000000' />
					<value target='ChildPosZ' data='-1.000000' />
					<value target='displayText' data='Testing
Testing
1, 2, 3' />
					<value target='text' data='Testing
Testing
1, 2, 3' />
					<value target='lines' data='5' />
					<value target='Font' data='Arial' />
					<value target='AlignX' data='001' />
					<value target='AlignY' data='000' />
					<value target='Color' data='16777215' />
					<value target='Background' data='' />
					<value target='Bezel' data='8882055' />
					<value target='bezel_thick' data='2.000000' />
					<value target='margin' data='1.000000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='8e91085e-f978-404f-9de9-56424c4b56dd' vmin='1' vmaj='1' codename='DynamicTextField1' x='0' y='0' z='3' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='Width' data='40.000000' />
					<value target='Height' data='30.000000' />
					<value target='TitleSize' data='8.000000' />
					<value target='TextSize' data='3.600000' />
					<value target='NumCols' data='002' />
					<value target='TitleColor' data='0' />
					<value target='Text1Color' data='255' />
					<value target='Text2Color' data='16711680' />
					<value target='Text3Color' data='255' />
					<value target='Text4Color' data='255' />
					<value target='BorderColor' data='8882055' />
					<value target='ShowTitle' data='1' />
					<value target='ClearOldData' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9a7d4e50-8d7e-4c5e-9a93-7948ab47edad' vmin='0' vmaj='1' codename='ComboBoard1' x='-40' y='-32.9975' z='-5.125' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='PinA0' data='$PORTA.0' />
					<value target='PinA1' data='$PORTA.1' />
					<value target='PinA2' data='$PORTA.2' />
					<value target='PinA3' data='$PORTA.3' />
					<value target='PinA4' data='$PORTA.4' />
					<value target='PinA5' data='$PORTA.5' />
					<value target='PinA6' data='$PORTA.6' />
					<value target='PinA7' data='$PORTA.7' />
					<value target='PinB0' data='$PORTB.0' />
					<value target='PinB1' data='$PORTB.1' />
					<value target='PinB2' data='$PORTB.2' />
					<value target='PinB3' data='$PORTB.3' />
					<value target='PinB4' data='$PORTB.4' />
					<value target='PinB5' data='$PORTB.5' />
					<value target='PinB6' data='$PORTB.6' />
					<value target='PinB7' data='$PORTB.7' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='9737364' img='' style='0' />
		<camera xe='21.8732' ye='-13.775' ze='203.412' xt='21.8732' yt='-13.775' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='1' lighting='2' brightness='0' perspective='0' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7884836' img='' style='0' size='25' />
		<camera xe='-40.2288' ye='-22.7616' ze='182.872' xt='-40.2288' yt='-22.7616' 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='LED_task' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='0' scrolly='278' flags='0' />
		<view type='0' name='main_overcooked' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='120' scrolly='99' flags='0' />
		<view type='0' name='main_cancelled' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='0' scrolly='128' flags='0' />
		<view type='0' name='main_done' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='245' scrolly='232' flags='0' />
		<view type='0' name='main_cooking' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='0' scrolly='207' flags='0' />
		<view type='0' name='main_ready' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='0' scrolly='142' flags='0' />
		<view type='0' name='main_welcome' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='258' scrolly='209' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='key_task' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Timer_2_ISR' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Timer_0_ISR' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='44' scrolly='343' flags='0' />
		<view type='0' name='LCD_task' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAqAIAAEYCAAA' zoom='100' scrollx='0' scrolly='320' flags='0' />
	</layout>
</document>
</root>
