<root>
<document schema='101' license='1,Default Flowcode Name,EA6R55' title='' description='' target='PIC.16F.16F1938' >
	<config data='!0,fe4!10,1733%0,4%3,0%5,1%6,1%7,1%8,1%9,3%b,1%c,0%d,0%10,3%14,3%18,1%19,1%1a,1%1c,1%1d,0' clkspd='32000000' 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='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 >
		<watch expr='DISP' />
		<watch expr='DisableIOC' />
		<watch expr='OUT' />
		<watch expr='Seconds' />
		<watch expr='TimerTick' />
		<watch expr='in' />
	</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='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DISP' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='TimerTick' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DisableIOC' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Seconds' type='u8' description='' isconst='0' isinit='1' usrinit='1000' setinit='1000' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='OUT' type='u8' description='' isconst='0' isinit='1' usrinit='125' setinit='125' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Candy' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='ClearLine' >
							<argument exp='0' />
						</command>
						<command class_type='output' title='Output' mode='1' port='1048576' mask='4' exp='1' />
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
							<argument exp='&quot;Candy&quot;' />
						</command>
						<command class_type='delay' title='Delay' exp='1' type='0' />
						<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' component='ServoController' macro='SetPosition' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='comment' title='' comment='Old: 200 ms' textarea='12,0,12,0' />
						<command class_type='delay' title='Delay' exp='2' type='2' />
						<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' component='ServoController' macro='SetPosition' >
							<argument exp='0' />
							<argument exp='125' />
						</command>
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Clear' />
						<command class_type='delay' title='Delay' exp='2' type='1' />
						<command class_type='output' title='Output' mode='1' port='1048576' mask='4' exp='0' />
						<command class_type='delay' title='Delay' exp='1' type='1' />
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
							<argument exp='&quot;Candy done&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='ClearLine' >
							<argument exp='0' />
						</command>
						<command class_type='delay' title='Delay' exp='1' type='1' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Button' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='Decision' exp='DisableIOC' swap='0' >
							<flowline />
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='DISP = 2' />
									<exp exp='DisableIOC = 1 //Allows for contact bounce' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Timer2ISR' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='Decision' exp='TimerTick &lt; 125' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='TimerTick = TimerTick + 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='TimerTick = 0' />
									<exp exp='' />
								</command>
								<command class_type='decision' title='Decision' exp='Seconds &gt; 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Seconds = Seconds - 1' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='native' title='C Code' textarea='36,0,511,300' ccode='iocbp=0Xff;
osccon=0xF0;' language='C' />
						<command class_type='comment' title='' comment='Old Speed:19660800
New Speed: 32000000' textarea='12,0,12,0' />
						<command class_type='output' title='Output' mode='1' port='1048576' mask='4' exp='0' />
						<command class_type='output' title='Output' mode='1' port='1048576' mask='2' exp='0' />
						<command class_type='call' title='Initialise Servo Motor' textarea='36,0,511,300' component='ServoController' macro='Initialise' />
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Start' />
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
							<argument exp='&quot;Initializing...&quot;' />
						</command>
						<command class_type='delay' title='Delay' exp='1' type='2' />
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Clear' />
						<command class_type='call' title='Enable Servo 0' textarea='36,0,511,300' component='ServoController' macro='EnableServo' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' disable='1' component='ServoController' macro='SetPosition' >
							<argument exp='0' />
							<argument exp='125' />
						</command>
						<command class_type='interrupt' title='Interrupt' enable='1' name='IOC0' call='Button' >
							<settings timer='0' prescale='-1' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='-wL-----------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='-wD-----------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
							</settings>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='DISP = 0' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='1' >
							<flowline >
								<command class_type='loop' title='Loop' type='1' exp='DISP' start='0' >
									<flowline >
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
											<argument exp='0' />
											<argument exp='0' />
										</command>
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
											<argument exp='&quot;Waiting Button&quot;' />
										</command>
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
											<argument exp='0' />
											<argument exp='1' />
										</command>
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
											<argument exp='&quot;DISP=&quot;' />
										</command>
										<command class_type='delay' title='Delay' exp='5' type='0' />
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintNumber' >
											<argument exp='DISP' />
										</command>
										<command class_type='delay' title='Delay' exp='100' type='1' />
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
											<argument exp='12' />
											<argument exp='1' />
										</command>
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
											<argument exp='&quot;Loop&quot;' />
										</command>
										<command class_type='loop' title='Loop' type='2' exp='2' >
											<flowline >
												<command class_type='output' title='Output' mode='1' port='1048576' mask='2' exp='1' />
												<command class_type='delay' title='Delay' exp='200' type='1' />
												<command class_type='output' title='Output' mode='1' port='1048576' mask='2' exp='0' />
												<command class_type='delay' title='Delay' exp='200' type='1' />
											</flowline>
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Call Macro' macro='Candy' />
								<command class_type='delay' title='Delay' exp='1' type='1' />
								<command class_type='calculation' title='Calculation' >
									<exp exp='DISP = 0' />
									<exp exp='DisableIOC = 0' />
								</command>
								<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Clear' />
								<command class_type='delay' title='Delay' exp='1' type='1' />
								<command class_type='call' title='Call Component Macro' disable='1' component='lcd_eb005' macro='Cursor' >
									<argument exp='5' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Call Component Macro' disable='1' component='lcd_eb005' macro='PrintNumber' >
									<argument exp='DISP' />
								</command>
								<command class_type='delay' title='Delay' disable='1' exp='1' type='2' />
								<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
									<argument exp='&quot;Candy Dispence&quot;' />
								</command>
								<command class_type='delay' title='Delay' exp='1' type='2' />
								<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Clear' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='9202a62e-0a42-4780-adce-16b701e5ec53' vmin='2' vmaj='1' codename='ServoController' x='-56' y='48' z='2' xsz='4.16667' ysz='4.16667' zsz='0.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='Channel_Count' data='001' />
					<value target='pin0' data='$PORTB.0' />
					<value target='pin1' data='$PORTB.1' />
					<value target='pin2' data='$PORTB.2' />
					<value target='pin3' data='$PORTB.3' />
					<value target='pin4' data='$PORTB.4' />
					<value target='pin5' data='$PORTB.5' />
					<value target='pin6' data='$PORTB.6' />
					<value target='pin7' data='$PORTB.7' />
					<value target='trim0' data='000' />
					<value target='trim1' data='0' />
					<value target='trim2' data='0' />
					<value target='trim3' data='0' />
					<value target='trim4' data='0' />
					<value target='trim5' data='0' />
					<value target='trim6' data='0' />
					<value target='trim7' data='0' />
					<value target='min_pulse_width' data='1280' />
					<value target='max_pulse_width' data='2500' />
					<value target='CCPLo' data='32' />
					<value target='CCPHi' data='78' />
					<value target='Servo_Clock_Count_25' data='200' />
					<value target='Servo_Clock_Count_1280' data='10240' />
					<value target='Servo_Clock_Count_2500' data='20000' />
					<value target='Servo_Period_Multiplier' data='38' />
					<value target='Divider' data='0' />
					<value target='RoundUp' data='0' />
					<value target='sim0' data='ServoMotor' />
					<value target='sim1' data='' />
					<value target='sim2' data='' />
					<value target='sim3' data='' />
					<value target='sim4' data='' />
					<value target='sim5' data='' />
					<value target='sim6' data='' />
					<value target='sim7' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='cc031290-2255-4e8d-b382-1998c8dda95a' vmin='1' vmaj='1' codename='ServoMotor' x='24' y='64' 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='target_object' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='d29dda88-17de-4008-991a-c881890d4c57' vmin='1' vmaj='1' codename='lcd_eb005' x='-50.322' y='-8.29484' 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='Pin_Data_0' data='$PORTC.0' />
					<value target='Pin_Data_1' data='$PORTC.1' />
					<value target='Pin_Data_2' data='$PORTC.2' />
					<value target='Pin_Data_3' data='$PORTC.3' />
					<value target='Pin_RS' data='$PORTC.4' />
					<value target='Pin_E' data='$PORTC.5' />
				</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='43.6862' y='-3.59443' z='0' xsz='1' ysz='1' zsz='1' xang='-47.1646' yang='0' zang='0' xquat='-0.400066' yquat='0' zquat='0' wquat='0.916486' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTB.1' />
					<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='label1' x='74.2066' y='45.3207' z='0' xsz='8' ysz='8' 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='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='RB0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label2' x='66.2344' y='4.39947' z='0' xsz='8' ysz='8' 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='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='B1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label3' x='-52.6122' y='-30.1624' z='0' xsz='8' ysz='8' 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='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='RC0-1-2-3-4-5' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label4' x='48.0319' y='-18.5496' z='0' xsz='8' ysz='8' 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='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='Active High' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='led_5mm_clip1' 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 >
					<value target='pin' data='$PORTA.1' />
					<value target='polarity' data='001' />
					<value target='on_color' data='255' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='led_5mm_clip2' x='0.875671' y='-15.7602' 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='pin' data='$PORTA.2' />
					<value target='polarity' data='001' />
					<value target='on_color' data='8453975' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</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='1' lighting='2' brightness='0' perspective='0' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7884836' img='' style='0' size='25' />
		<camera xe='-1' ye='15.321' ze='300.272' xt='-1' yt='15.321' zt='11.2369' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAANQUAAHkCAAA' zoom='75' scrollx='0' scrolly='522' flags='0' />
		<view type='0' name='Candy' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAANQUAAHkCAAA' zoom='75' scrollx='0' scrolly='165' flags='0' />
		<view type='0' name='Button' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAANQUAAHkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Timer2ISR' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAANQUAAHkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
