<root>
<document schema='101' license='1,407charles,AUQQUZ' title='' description='' target='AVR.ATMEGA.Arduino Mega ADK 2560' >
	<config data='' clkspd='16000000' 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='0' />
			<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='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
			<data name='anlpres' value='255' />
			<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 />
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='483c1420-0b36-4c5f-a98a-bd0e634ea878' 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='pointer2' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='back' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='oldname' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ptr' type='u16' description='eprom adress byte' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='name' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ASCII' type='u8' description='' isconst='0' isinit='1' usrinit='65' setinit='65' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='oneshot' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='bypass' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Yo' type='u8' description='' isconst='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ptr3' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ptr2' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='filename' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Byte' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='16' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SD_Download' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='return' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='old_ASCII' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Channel_B' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Channel_A' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='enter' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='pointer' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='retval' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='next' type='b1' description='' isconst='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='y' type='u8' description='' isconst='0' isinit='1' usrinit='10' setinit='10' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='x' type='u8' description='' isconst='0' isinit='1' usrinit='8' setinit='8' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='w' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='16' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Write_sector_bit' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='p' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='n' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='x2' type='u8' description='' isconst='0' isinit='1' usrinit='20' setinit='20' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SD_card' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Loop' type='u8' description='' isconst='0' isinit='1' usrinit='16' setinit='16' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Channel_A_Old' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ready' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Encoder' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='delay' title='Delay' exp='2' type='1' />
						<command class_type='calculation' title='Calculation' textarea='36,0,511,300' >
							<exp exp='Channel_A_Old = Channel_A' />
						</command>
						<command class_type='input' title='Input Channel A' textarea='36,0,511,300' mode='1' port='1048577' mask='1' exp='Channel_A' />
						<command class_type='input' title='Input Channel B' textarea='36,0,511,300' mode='1' port='1048577' mask='2' exp='Channel_B' />
						<command class_type='decision' title='Decision' exp='Channel_A = Channel_A_Old' swap='0' >
							<flowline />
							<flowline >
								<command class_type='decision' title='Decision' textarea='36,0,511,300' exp='Channel_A = 1' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' textarea='36,0,511,300' exp='Channel_B = 1' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' textarea='36,0,511,300' >
													<exp exp='ASCII = ASCII - 1' />
												</command>
												<command class_type='comment' title='' comment='Counter Clockwise Rotation' textarea='51,5,526,305' />
											</flowline>
											<flowline >
												<command class_type='comment' title='' comment='Clockwise Rotation' textarea='12,0,487,300' />
												<command class_type='calculation' title='Calculation' textarea='36,0,511,300' >
													<exp exp='ASCII = ASCII + 1' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='List' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialization' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='QuadEncoder1' macro='Enable' />
						<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Initialise' />
						<command class_type='delay' title='Delay' exp='1' type='2' />
						<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='SetForegroundColour' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='SetDisplayOrientation' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='ClearDisplay' />
						<command class_type='call' title='Print Startup String' component='gLCD_KS0108' macro='Print' >
							<argument exp='&quot;Waiting for Card&quot;' />
							<argument exp='1' />
							<argument exp='1' />
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='calculation' title='Assign filename' >
							<exp exp='filename = &quot;EEprom.txt&quot;' />
						</command>
						<command class_type='calculation' title='Initialise Return Value' >
							<exp exp='retval = 1' />
						</command>
						<command class_type='loop' title='Wait for card to start up' type='0' exp='retval &gt; 0' >
							<flowline >
								<command class_type='delay' title='Delay' exp='1' type='2' />
								<command class_type='call' title='Init FAT16' component='FAT1' macro='Initialise' >
									<return exp='retval' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Clear Display' component='gLCD_KS0108' macro='ClearDisplay' />
						<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
							<argument exp='&quot;Opening File&quot;' />
							<argument exp='1' />
							<argument exp='1' />
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='FAT1' macro='OpenFile' >
							<return exp='retval' />
							<argument exp='filename' />
						</command>
						<command class_type='decision' title='Decision' exp='retval' swap='0' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
									<argument exp='&quot;File Not Found&quot;' />
									<argument exp='1' />
									<argument exp='10' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
									<argument exp='&quot;Creating New File&quot;' />
									<argument exp='1' />
									<argument exp='20' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Create New File' component='FAT1' macro='CreateFile' >
									<return exp='retval' />
									<argument exp='Filename' />
								</command>
								<command class_type='decision' title='Decision' exp='retval = 1' swap='0' >
									<flowline />
									<flowline >
										<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
											<argument exp='&quot;File Created&quot;' />
											<argument exp='1' />
											<argument exp='30' />
											<argument exp='0' />
											<argument exp='1' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
									<argument exp='&quot;file Opened&quot;' />
									<argument exp='1' />
									<argument exp='10' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='retval = 0' />
						</command>
						<command class_type='delay' title='Delay' exp='3' type='2' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Menu' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='' component='gLCD_KS0108' macro='Print' >
							<argument exp='&quot;Enter New String&quot;' />
							<argument exp='3' />
							<argument exp='3' />
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='ASCII = 1' />
						</command>
						<command class_type='decision' title='Decision' exp='ASCII &lt;&gt; old_ASCII' swap='0' >
							<flowline >
								<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='ASCII' >
									<case >
										<flowline />
									</case>
									<case exp='1' >
										<flowline >
											<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='SetForegroundColour' >
												<argument exp='0' />
											</command>
											<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='DrawRectangle' >
												<argument exp='1' />
												<argument exp='1' />
												<argument exp='135' />
												<argument exp='11' />
												<argument exp='1' />
												<argument exp='0' />
											</command>
											<command class_type='calculation' title='Calculation' >
												<exp exp='ASCII = 1' />
											</command>
										</flowline>
									</case>
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='old_ASCII = ASCII' />
							<exp exp='' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Download_FAT_to_EEprom' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Clear Display' component='gLCD_KS0108' macro='ClearDisplay' />
						<command class_type='call' title='Print Opening File' component='gLCD_KS0108' macro='Print' >
							<argument exp='&quot;Opening File&quot;' />
							<argument exp='1' />
							<argument exp='1' />
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='filename = &quot;EEprom.txt&quot;' />
						</command>
						<command class_type='call' title='Open the file' component='FAT1' macro='OpenFile' >
							<return exp='retval' />
							<argument exp='filename' />
						</command>
						<command class_type='decision' title='Decision' exp='retval' swap='0' >
							<flowline >
								<command class_type='call' title='File Error' component='gLCD_KS0108' macro='Print' >
									<argument exp='&quot;File Error&quot;' />
									<argument exp='1' />
									<argument exp='10' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
									<argument exp='&quot;File Opened&quot;' />
									<argument exp='1' />
									<argument exp='10' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='delay' title='Delay' exp='1' type='2' />
								<command class_type='call' title='Clear Display' component='gLCD_KS0108' macro='ClearDisplay' />
								<command class_type='calculation' title='Calculation' >
									<exp exp='ptr2 = 0' />
									<exp exp='n = 0' />
								</command>
								<command class_type='loop' title='Loop' type='0' exp='1' >
									<flowline >
										<command class_type='loop' title='Read file sector - 16 x (16 x 2) = 512' type='2' exp='8' >
											<flowline >
												<command class_type='call' title='Clear LCD' component='gLCD_KS0108' macro='ClearDisplay' />
												<command class_type='calculation' title='Calculation' >
													<exp exp='y = 10' />
													<exp exp='n = 0' />
													<exp exp='' />
												</command>
												<command class_type='loop' title='Refresh LCD data' type='2' exp='4' >
													<flowline >
														<command class_type='loop' title='Refresh LCD Line' type='2' exp='16' >
															<flowline >
																<command class_type='call' title='Read a byte from the file' component='FAT1' macro='ReadByteFromFile' >
																	<return exp='Byte[n]' />
																</command>
																<command class_type='decision' title='Decision' exp='Byte[n] &gt; 0' swap='0' >
																	<flowline >
																		<command class_type='call' title='Call Component Macro' component='eeprom1' macro='Write' >
																			<argument exp='ptr2' />
																			<argument exp='Byte[n]' />
																		</command>
																		<command class_type='calculation' title='Calculation' >
																			<exp exp='n = n + 1' />
																			<exp exp='ptr2 = ptr2 + 1' />
																		</command>
																		<command class_type='decision' title='Decision' exp='oneshot = 1' swap='0' >
																			<flowline >
																				<command class_type='calculation' title='Calculation' >
																					<exp exp='' />
																					<exp exp='Byte[1] = 32' />
																					<exp exp='Byte[2] = 32' />
																					<exp exp='Byte[3] = 32' />
																					<exp exp='Byte[4] = 32' />
																					<exp exp='Byte[5] = 32' />
																					<exp exp='Byte[6] = 32' />
																					<exp exp='Byte[7] = 32' />
																					<exp exp='Byte[8] = 32' />
																					<exp exp='Byte[9] = 32' />
																					<exp exp='Byte[10] = 32' />
																					<exp exp='Byte[11] = 32' />
																					<exp exp='Byte[12] = 32' />
																					<exp exp='Byte[13] = 32' />
																					<exp exp='Byte[14] = 32' />
																					<exp exp='Byte[15] = 32' />
																					<exp exp='oneshot = 0' />
																				</command>
																			</flowline>
																			<flowline />
																		</command>
																		<command class_type='calculation' title='Calculation' >
																			<exp exp='w[0] = Byte[0]' />
																			<exp exp='w[1] = Byte[1]' />
																			<exp exp='w[2] = Byte[2]' />
																			<exp exp='w[3] = Byte[3]' />
																			<exp exp='w[4] = Byte[4]' />
																			<exp exp='w[5] = Byte[5]' />
																			<exp exp='w[6] = Byte[6]' />
																			<exp exp='w[7] = Byte[7]' />
																			<exp exp='w[8] = Byte[8]' />
																			<exp exp='w[9] = Byte[9]' />
																			<exp exp='w[10] = Byte[10]' />
																			<exp exp='w[11] = Byte[11]' />
																			<exp exp='w[12] = Byte[12]' />
																			<exp exp='w[13] = Byte[13]' />
																			<exp exp='w[14] = Byte[14]' />
																			<exp exp='w[15] = Byte[15]' />
																		</command>
																		<command class_type='call' title='Print Byte To LCD' component='gLCD_KS0108' macro='Print' >
																			<argument exp='w' />
																			<argument exp='1' />
																			<argument exp='y' />
																			<argument exp='0' />
																			<argument exp='1' />
																		</command>
																	</flowline>
																	<flowline >
																		<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='A' />
																	</flowline>
																</command>
															</flowline>
														</command>
														<command class_type='calculation' title='Calculation' >
															<exp exp='y = y + 10' />
															<exp exp='n = 0' />
															<exp exp='oneshot = 1' />
														</command>
													</flowline>
												</command>
												<command class_type='delay' title='Pause to read LCD data' exp='400' type='1' />
											</flowline>
										</command>
									</flowline>
								</command>
								<command class_type='label' title='Connection Point' labelid='0' labelname='A' />
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='ClearDisplay' />
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
									<argument exp='&quot;EOF Reached&quot;' />
									<argument exp='1' />
									<argument exp='50' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Load_EEprom_to_FAT' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='ClearDisplay' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='ptr3 = 0' />
							<exp exp='ptr2 = 0' />
						</command>
						<command class_type='loop' title='Loop' type='2' exp='32' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='n = 0' />
								</command>
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='ClearDisplay' />
								<command class_type='loop' title='Loop' type='2' exp='16' >
									<flowline >
										<command class_type='call' title='Call Component Macro' component='eeprom1' macro='Read' >
											<return exp='Byte[n]' />
											<argument exp='ptr2' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='ptr2 = ptr2 + 1' />
											<exp exp='n = n + 1' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='w[0] = Byte[0]' />
									<exp exp='w[1] = Byte[1]' />
									<exp exp='w[2] = Byte[2]' />
									<exp exp='w[3] = Byte[3]' />
									<exp exp='w[4] = Byte[4]' />
									<exp exp='w[5] = Byte[5]' />
									<exp exp='w[6] = Byte[6]' />
									<exp exp='w[7] = Byte[7]' />
									<exp exp='w[8] = Byte[8]' />
									<exp exp='w[9] = Byte[9]' />
									<exp exp='w[10] = Byte[10]' />
									<exp exp='w[11] = Byte[11]' />
									<exp exp='w[12] = Byte[12]' />
									<exp exp='w[13] = Byte[13]' />
									<exp exp='w[14] = Byte[14]' />
									<exp exp='w[15] = Byte[15]' />
								</command>
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
									<argument exp='w' />
									<argument exp='1' />
									<argument exp='40' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='delay' title='Delay' exp='100' type='1' />
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='PrintNumber' >
									<argument exp='ptr2' />
									<argument exp='1' />
									<argument exp='50' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='' />
									<exp exp='n = 0' />
								</command>
								<command class_type='loop' title='Loop' type='2' exp='16' >
									<flowline >
										<command class_type='call' title='Call Component Macro' component='FAT1' macro='WriteByteToBuffer' >
											<argument exp='ptr3' />
											<argument exp='w[n]' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='ptr3 = ptr3 + 1' />
											<exp exp='n = n + 1' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Call Component Macro' component='FAT1' macro='WriteFileSector' >
							<return exp='retval' />
						</command>
						<command class_type='decision' title='Decision' exp='retval = 0' swap='0' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
									<argument exp='&quot;Sector Writte Succesful&quot;' />
									<argument exp='1' />
									<argument exp='20' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
									<argument exp='&quot;Sector Writte Fail&quot;' />
									<argument exp='1' />
									<argument exp='20' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Call Component Macro' component='FAT1' macro='MoveToNextFileSector' >
							<return exp='next' />
							<argument exp='1' />
						</command>
						<command class_type='decision' title='Decision' exp='next = 0' swap='0' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
									<argument exp='&quot;New Sector Set&quot;' />
									<argument exp='1' />
									<argument exp='30' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='PrintNumber' >
									<argument exp='ptr3' />
									<argument exp='100' />
									<argument exp='50' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='n = 0' />
									<exp exp='SD_card = 0' />
								</command>
								<command class_type='delay' title='Delay' exp='3' type='2' />
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
									<argument exp='&quot;New Sector Fail&quot;' />
									<argument exp='1' />
									<argument exp='30' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='ClearDisplay' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='  The Program copies the contents of the EEPROM and load it to FAT.
Just press Upload button to write the data to Fat sector one. 
The data is copied 512 bytes per sector, after a sector is written 
press upload to copy the same data to the next sector or write some 
new data atby prssing enter to write a new string to EEPROM, you can
turn the encoder and press enter to enter new ASCII character or just
scroll encoder to a desire character and keep press enter to upload a 
complete 16 byte string to EEPROM and press to upload to load to FAT 
new sector. 
Watch how data is set at EEPROM while writing and the result data
loaded to FAT by using the console.Data transfer is also shown at GLCD
 Check FAT Data and FAT Buffer at console to check results. The program 
is intented for data transfer, it&apos;s a section of a program that 
I modified to try this new component (at least for me). Don&apos;t forget to 
set the new root directory on the bottom of panel properties to create 
the file, it has to be an exixting folder on your computer before 
running the simulator.
 
' textarea='12,0,12,0' />
						<command class_type='call' title='Call Macro' macro='Initialization' />
						<command class_type='interrupt' title='Interrupt' enable='1' name='IOC0' call='Encoder' >
							<settings timer='0' prescale='-1' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='-wP-----------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='-wP-----------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
							</settings>
						</command>
						<command class_type='label' title='Connection Point' labelid='2' labelname='C' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='x = 8' />
							<exp exp='x2 = 20' />
						</command>
						<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='ClearDisplay' />
						<command class_type='loop' title='Loop' type='0' exp='1' >
							<flowline >
								<command class_type='input' title='Input' mode='1' port='1048577' mask='32' exp='SD_Download' />
								<command class_type='input' title='Input' mode='1' port='1048577' mask='16' exp='SD_card' />
								<command class_type='input' title='Input' mode='1' port='1048577' mask='4' exp='back' />
								<command class_type='decision' title='Decision' exp='SD_card = 1' swap='0' >
									<flowline >
										<command class_type='call' title='Call Macro' macro='Load_EEprom_to_FAT' />
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='Decision' exp='SD_Download = 1' swap='0' >
									<flowline >
										<command class_type='call' title='Call Macro' macro='Download_FAT_to_EEprom' />
									</flowline>
									<flowline />
								</command>
								<command class_type='input' title='Input' mode='1' port='1048577' mask='8' exp='enter' />
								<command class_type='call' title='Call Macro' macro='Menu' />
								<command class_type='decision' title='Decision' exp='enter = 1 &amp; ASCII = 1' swap='0' >
									<flowline >
										<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' />
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
						<command class_type='label' title='Connection Point' labelid='0' labelname='A' />
						<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='ClearDisplay' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='ASCII = 65' />
							<exp exp='n = 0' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='1' >
							<flowline >
								<command class_type='input' title='Input' mode='1' port='1048577' mask='8' exp='enter' />
								<command class_type='input' title='Input' mode='1' port='1048577' mask='4' exp='back' />
								<command class_type='decision' title='Decision' exp='ASCII &lt; 32' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='ASCII = 90' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Decision' exp='ASCII &gt; 90' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='ASCII = 32' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Decision' exp='enter = 1' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' exp='n &gt;= 16' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='name = name + 1' />
													<exp exp='old_ASCII = ASCII' />
													<exp exp='w[0] = 32' />
													<exp exp='w[1] = 32' />
													<exp exp='w[2] = 32' />
													<exp exp='w[3] = 32' />
													<exp exp='w[4] = 32' />
													<exp exp='w[5] = 32' />
													<exp exp='w[6] = 32' />
													<exp exp='w[7] = 32' />
													<exp exp='w[8] = 32' />
													<exp exp='w[9] = 32' />
													<exp exp='w[10] = 32' />
													<exp exp='w[11] = 32' />
													<exp exp='w[12] = 32' />
													<exp exp='w[13] = 32' />
													<exp exp='w[14] = 32' />
													<exp exp='w[15] = 32' />
												</command>
												<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='ClearDisplay' />
												<command class_type='goto' title='Goto Connection Point' labelid='2' labelname='' />
											</flowline>
											<flowline >
												<command class_type='delay' title='Delay' exp='150' type='1' />
												<command class_type='calculation' title='Calculation' >
													<exp exp='n = n + 1' />
													<exp exp='x = x + 12' />
													<exp exp='x2 = x2 + 12' />
													<exp exp='' />
												</command>
												<command class_type='call' title='Call Component Macro' component='eeprom1' macro='Write' >
													<argument exp='ptr' />
													<argument exp='ASCII' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='ptr = ptr + 1' />
												</command>
												<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='SetForegroundColour' >
													<argument exp='1' />
												</command>
												<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='DrawRectangle' >
													<argument exp='5' />
													<argument exp='35' />
													<argument exp='25' />
													<argument exp='45' />
													<argument exp='0' />
													<argument exp='1' />
												</command>
												<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='SetForegroundColour' >
													<argument exp='0' />
												</command>
												<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='PrintNumber' >
													<argument exp='ptr' />
													<argument exp='5' />
													<argument exp='35' />
													<argument exp='0' />
													<argument exp='1' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Decision' exp='back = 1' swap='0' >
											<flowline >
												<command class_type='delay' title='150' exp='150' type='1' />
												<command class_type='decision' title='Decision' exp='x &lt;= 10' swap='0' >
													<flowline >
														<command class_type='calculation' title='Calculation' >
															<exp exp='n = 0' />
															<exp exp='x = 8' />
															<exp exp='x2 = 20' />
															<exp exp='ptr = 0' />
														</command>
														<command class_type='call' title='Set color to backgroud color' component='gLCD_KS0108' macro='SetForegroundColour' >
															<argument exp='1' />
														</command>
														<command class_type='call' title='Clear humidity numbers' component='gLCD_KS0108' macro='DrawRectangle' >
															<argument exp='x' />
															<argument exp='1' />
															<argument exp='x2' />
															<argument exp='7' />
															<argument exp='0' />
															<argument exp='1' />
														</command>
														<command class_type='call' title='restore foreground color' component='gLCD_KS0108' macro='SetForegroundColour' >
															<argument exp='0x00' />
														</command>
													</flowline>
													<flowline >
														<command class_type='call' title='Set color to backgroud color' component='gLCD_KS0108' macro='SetForegroundColour' >
															<argument exp='1' />
														</command>
														<command class_type='call' title='Clear humidity numbers' component='gLCD_KS0108' macro='DrawRectangle' >
															<argument exp='x' />
															<argument exp='1' />
															<argument exp='x2' />
															<argument exp='7' />
															<argument exp='0' />
															<argument exp='1' />
														</command>
														<command class_type='call' title='restore foreground color' component='gLCD_KS0108' macro='SetForegroundColour' >
															<argument exp='0x00' />
														</command>
														<command class_type='calculation' title='Calculation' >
															<exp exp='w[n] = 0' />
															<exp exp='n = n - 1' />
															<exp exp='x = x - 12' />
															<exp exp='x2 = x2 - 12' />
															<exp exp='ptr = ptr - 1' />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='' />
									<exp exp='w[n] = ASCII' />
									<exp exp='' />
								</command>
								<command class_type='decision' title='Decision' exp='ASCII &lt;&gt; old_ASCII OR enter = 1' swap='0' >
									<flowline >
										<command class_type='call' title='Set color to backgroud color' component='gLCD_KS0108' macro='SetForegroundColour' >
											<argument exp='1' />
										</command>
										<command class_type='call' title='Clear humidity numbers' component='gLCD_KS0108' macro='DrawRectangle' >
											<argument exp='x' />
											<argument exp='1' />
											<argument exp='x2' />
											<argument exp='21' />
											<argument exp='0' />
											<argument exp='1' />
										</command>
										<command class_type='call' title='restore foreground color' component='gLCD_KS0108' macro='SetForegroundColour' >
											<argument exp='0x00' />
										</command>
										<command class_type='call' title='Call Component Macro' component='gLCD_KS0108' macro='Print' >
											<argument exp='w' />
											<argument exp='10' />
											<argument exp='1' />
											<argument exp='1' />
											<argument exp='1' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='old_ASCII = ASCII' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='3531a68d-7686-44b7-a3a5-67afda8467dc' vmin='3' vmaj='1' codename='QuadEncoder1' x='-48' y='-72' z='9.2388' 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='pin_a' data='$PORTB.0' />
					<value target='pin_b' data='$PORTB.1' />
					<value target='reprate' data='075' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='5c1da48f-ce54-4622-bdd9-fc812e373696' vmin='0' vmaj='1' codename='sw_push_rnd_pnl1' x='0' y='-72' z='-6.175' 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='pin' data='$PORTB.3' />
					<value target='polarity' data='000' />
					<value target='debounce' data='10' />
					<value target='operation' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='5c1da48f-ce54-4622-bdd9-fc812e373696' vmin='0' vmaj='1' codename='sw_push_rnd_pnl2' x='32' y='-72' z='-6.175' 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='pin' data='$PORTB.2' />
					<value target='polarity' data='000' />
					<value target='debounce' data='10' />
					<value target='operation' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c9d3b357-b914-4301-a741-0d13819e441c' vmin='3' vmaj='1' codename='gLCD_KS0108' x='8' y='72.0001' z='3' xsz='1.70895' ysz='2.89745' 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='pixel_height' data='64' />
					<value target='pixel_width' data='192' />
					<value target='ControllerCount' data='003' />
					<value target='monochrome' data='1' />
					<value target='foreground_colour' data='0' />
					<value target='background_colour' data='16777215' />
					<value target='colour_bit_depth' data='1' />
					<value target='red_bit_depth' data='0' />
					<value target='green_bit_depth' data='0' />
					<value target='blue_bit_depth' data='0' />
					<value target='chip_sel1_pin' data='$PORTA.6' />
					<value target='chip_sel2_pin' data='$PORTA.2' />
					<value target='chip_sel3_pin' data='$PORTA.0' />
					<value target='a0_pin' data='$PORTA.5' />
					<value target='read_write_pin' data='$PORTA.3' />
					<value target='enable_pin' data='$PORTA.1' />
					<value target='data0_pin' data='$PORTC.0' />
					<value target='data1_pin' data='$PORTC.1' />
					<value target='data2_pin' data='$PORTC.2' />
					<value target='data3_pin' data='$PORTC.3' />
					<value target='data4_pin' data='$PORTC.4' />
					<value target='data5_pin' data='$PORTC.5' />
					<value target='data6_pin' data='$PORTC.6' />
					<value target='data7_pin' data='$PORTC.7' />
					<value target='reset_pin' data='$PORTA.4' />
					<value target='DisplayMethod' data='000' />
					<value target='EnableDelay' data='10' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='dcbf571f-a6fa-402d-bdd4-be00cca4070f' vmin='1' vmaj='1' codename='eeprom1' x='80' y='-56' z='1.24088' xsz='20' ysz='20' zsz='20' 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='EESize' data='4096 byte' />
					<value target='EEbitdepth' data='8 bit' />
					<value target='InitialValues' data='0,1,0x2,0x03,&apos;A&apos;,&apos;b&apos;,&quot;Hello&quot;' />
					<value target='InitValsParsed' data='0,1,0x2,0x03,&apos;A&apos;,&apos;b&apos;,&apos;H&apos;,&apos;e&apos;,&apos;l&apos;,&apos;l&apos;,&apos;o&apos;' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='0b61bd39-05a3-46ee-a2a5-da7bffb583c5' vmin='5' vmaj='2' codename='FAT1' x='80' y='-104' z='1.4' 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='max_concurrent_files' data='2' />
					<value target='EOFtype' data='001' />
					<value target='Channel' data='000' />
					<value target='PR_SCALE' data='004' />
					<value target='PR_SCALE2' data='001' />
					<value target='cs_pin' data='$PORTE.5' />
					<value target='mosi_pin' data='$PORTH.3' />
					<value target='miso_pin' data='$PORTH.4' />
					<value target='sck_pin' data='$PORTH.5' />
					<value target='MosiRemap' data='000' />
					<value target='MisoRemap' data='000' />
					<value target='ClkRemap' data='000' />
					<value target='root_dir' data='C:\Users\charlie\Documents\flocode work\My Proyects' />
					<value target='AutoInsertCard' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label1' x='0' y='-48' z='0' xsz='8' ysz='15' 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='Color' data='0' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='Enter' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label2' x='32' y='-48' z='0' xsz='8' ysz='15' 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='Color' data='0' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='Back' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='5c1da48f-ce54-4622-bdd9-fc812e373696' vmin='0' vmaj='1' codename='sw_push_rnd_pnl3' x='0' y='-120' z='-6.175' 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='pin' data='$PORTB.4' />
					<value target='polarity' data='000' />
					<value target='debounce' data='10' />
					<value target='operation' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label3' x='0' y='-96' z='2.25' xsz='8.07477' ysz='16' zsz='0' 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='Color' data='0' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data=' Upload' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='5c1da48f-ce54-4622-bdd9-fc812e373696' vmin='0' vmaj='1' codename='sw_push_rnd_pnl4' x='32' y='-120' z='-6.175' 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='pin' data='$PORTB.5' />
					<value target='polarity' data='000' />
					<value target='debounce' data='10' />
					<value target='operation' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label4' x='32' y='-96' z='-0.25' xsz='7.2518' ysz='16' 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='Color' data='0' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='Download' />
				</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='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='25' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAfgQAAEMCAAA' zoom='50' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialization' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAfgQAAEMCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Menu' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAfgQAAEMCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Encoder' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAfgQAAEMCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Load_EEprom_to_FAT' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAfgQAAEMCAAA' zoom='50' scrollx='0' scrolly='63' flags='0' />
		<view type='0' name='Download_FAT_to_EEprom' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAfgQAAEMCAAA' zoom='50' scrollx='0' scrolly='1846' flags='0' />
	</layout>
</document>
</root>
