<root>
<document schema='101' license='1,Ben Rowland,XHZ9AR' title='' description='' target='PIC.16F.16F877A' >
	<config data='!0,3f7a%0,2%2,0%3,1%6,1%7,0%9,3%b,1%8,1%d,1' 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='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='monitor' value='1' />
			<data name='ictloop' value='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
		</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='' 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='in' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Y' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='X' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Old_Y' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Old_X' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='encoder' description='' >
						<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' component='v5__quadenc0' macro='CheckForChanges' />
						<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' component='v5__quadenc1' macro='CheckForChanges' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' component='v5__glcd0' macro='Initialise' />
						<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' component='v5__glcd0' macro='SetForegroundColour' >
							<argument exp='0' />
							<argument exp='0' />
							<argument exp='255' />
						</command>
						<command class_type='comment' title='' comment='Both Encoders need to be enabled before they can be used.' textarea='500,13,500,13' />
						<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' component='v5__quadenc0' macro='Enable' />
						<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' component='v5__quadenc1' macro='Enable' />
						<command class_type='comment' title='' comment='Enable an interrupt on Port B so any changes trigger this macro.' textarea='500,10,500,10' />
						<command class_type='interrupt' title='Interrupt' textarea='36,0,511,300' enable='1' name='IOC0' call='encoder' >
							<settings timer='0' prescale='-1' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='0' />
								<option value='0' />
								<option value='0' />
								<option value='0' />
							</settings>
						</command>
						<command class_type='loop' title='Loop' textarea='36,0,511,300' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' component='v5__quadenc0' macro='ReadCounter' >
									<return exp='in' />
								</command>
								<command class_type='calculation' title='Calculation' textarea='36,0,511,300' >
									<exp exp='X = in + 120' />
									<exp exp='' />
								</command>
								<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' component='v5__quadenc1' macro='ReadCounter' >
									<return exp='in' />
								</command>
								<command class_type='calculation' title='Calculation' textarea='36,0,511,300' >
									<exp exp='Y = in + 160' />
								</command>
								<command class_type='decision' title='Decision' textarea='36,0,511,300' exp='(X != Old_X) || (Y != Old_Y)' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' textarea='36,0,511,300' exp='(X &gt;= 0) &amp;&amp; (X &lt; 240)' swap='0' >
											<flowline >
												<command class_type='decision' title='Decision' textarea='36,0,511,300' exp='(Y &gt;= 0) &amp;&amp; (Y &lt; 320)' swap='0' >
													<flowline >
														<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' component='v5__glcd0' macro='Plot' >
															<argument exp='X' />
															<argument exp='Y' />
														</command>
														<command class_type='calculation' title='Calculation' textarea='36,0,511,300' >
															<exp exp='Old_X = X' />
															<exp exp='Old_Y = Y' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='c6586b24-9a1c-4e19-8051-8ae5923c418a' vmin='5' vmaj='1' codename='v5__glcd0' x='-57.9048' y='-1.52381' 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 >
					<value target='pixel_height' data='320' />
					<value target='pixel_width' data='240' />
					<value target='monochrome' data='0' />
					<value target='foreground_colour' data='0' />
					<value target='background_colour' data='16777215' />
					<value target='colour_bit_depth' data='16' />
					<value target='red_bit_depth' data='5' />
					<value target='green_bit_depth' data='6' />
					<value target='blue_bit_depth' data='5' />
					<value target='channel' data='1' />
					<value target='reset_pin' data='$PORTC0.5' />
					<value target='tx_pin' data='$PORTC.6' />
					<value target='rx_pin' data='$PORTC.7' />
					<value target='HighSpeed' data='1' />
					<value target='TXRemap' data='' />
					<value target='RXRemap' data='000' />
					<value target='DisplayMethod' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='3531a68d-7686-44b7-a3a5-67afda8467dc' vmin='2' vmaj='1' codename='v5__quadenc0' x='-21.1758' y='-1.41525' z='0.57143' xsz='10.5714' ysz='10.5714' zsz='1.14286' 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='pin_a' data='$PORTB0.4' />
					<value target='pin_b' data='$PORTB0.5' />
					<value target='reprate' data='075' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='3531a68d-7686-44b7-a3a5-67afda8467dc' vmin='2' vmaj='1' codename='v5__quadenc1' x='-7.46152' y='-1.41525' z='0.57143' xsz='10.5714' ysz='10.5714' zsz='1.14286' 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='pin_a' data='$PORTB0.6' />
					<value target='pin_b' data='$PORTB0.7' />
					<value target='reprate' data='075' />
				</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='76' perspective='0' >
		<background rgb='8404224' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='39' />
		<camera xe='-51' ye='-3' ze='132.513' xt='-51' yt='-3' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAA4gMAAMABAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
