<root>
<document schema='101' license='1,FlowFactory,YPTFVX' title='' description='' target='AVR.ATMEGA.Arduino Nano 328' >
	<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='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='AccelPitch' />
		<watch expr='AccelReal' />
		<watch expr='AccelRoll' />
		<watch expr='Accel' />
		<watch expr='DataReceived' />
		<watch expr='FilterPitch' />
		<watch expr='FilterRoll' />
		<watch expr='GyroPitch' />
		<watch expr='GyroReal' />
		<watch expr='GyroRoll' />
		<watch expr='Gyro' />
		<watch expr='SRCalc' />
	</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='1' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='0' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='11' />
			<data name='CalculatedCommsDelay' value='11' />
		</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='6675365c-6986-4454-858f-ca54fb7f8034' 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 >
				<property name='Accel 1G' target='Accel1G' typeid='21' hidden='0' locked='1' info='' />
				<property name='Gyro Time Constant' target='GyroTime' typeid='15' hidden='0' locked='0' info='' />
				<property name='Gyro Range (°/S)' target='GyroRange' typeid='21' hidden='0' locked='0' info='' />
				<property name='Gyro Bit Depth' target='GyroDepth' typeid='21' hidden='0' locked='0' info='' />
				<property name='Gyro Resolution' target='GyroRes' typeid='15' hidden='0' locked='1' info='' />
				<property name='Response Time' target='ResponseTime' typeid='15' hidden='0' locked='0' info='' />
			</properties>
			<values >
				<value target='Accel1G' data='16384' />
				<value target='GyroTime' data='0.040000' />
				<value target='GyroRange' data='250' />
				<value target='GyroDepth' data='15' />
				<value target='GyroRes' data='0.007629' />
				<value target='ResponseTime' data='0.075000' />
			</values>
			<events >
				<event class='Components' event='Property' target='Ev_Property' />
			</events>
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='AccelRoll' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FilterRoll' type='f32' description='' isconst='0' isinit='1' usrinit='0.0' setinit='0.0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='counter' 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='AccelReal' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' >
						<array size='3' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='GyroRoll' type='f32' description='' isconst='0' isinit='1' usrinit='0.0' setinit='0.0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Accel' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' >
						<array size='3' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AccelPitch' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FilterPitch' type='f32' description='' isconst='0' isinit='1' usrinit='0.0' setinit='0.0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Disp_string' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='GyroPitch' type='f32' description='' isconst='0' isinit='1' usrinit='0.0' setinit='0.0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='GyroReal' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' >
						<array size='3' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Gyro' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' >
						<array size='3' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='PHI' type='f32' description='180 / PI' isconst='1' isinit='1' usrinit='57.295780181884765625' setinit='57.2957795131' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SRCalc' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</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='ProcessFilterData' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='a' type='f32' description='' isconst='0' isinit='1' usrinit='0.0' setinit='0.0' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.a = ResponseTime / (ResponseTime + GyroTime)' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='FilterPitch = .a * (FilterPitch + GyroPitch * GyroTime) + (1 - .a) * AccelPitch' />
							<exp exp='FilterRoll = .a * (FilterRoll + GyroReal[1] * GyroTime) + (1 - .a) * AccelRoll' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ProcessAccelData' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='AccelReal[0] = FLOAT Accel[0] / FLOAT Accel1G' />
							<exp exp='AccelReal[1] = FLOAT Accel[1] / FLOAT Accel1G' />
							<exp exp='AccelReal[2] = FLOAT Accel[2] / FLOAT Accel1G' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='AccelRoll = atan2 (AccelReal[1],AccelReal[2]) * PHI' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='SRCalc = (AccelReal[1] * AccelReal[1])' />
							<exp exp='SRCalc = SRCalc + (AccelReal[2] * AccelReal[2])' />
							<exp exp='SRCalc = sqrt (SRCalc)' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='AccelPitch = atan2 (AccelReal[0],SRCalc) * PHI' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='AccelPitch = 0.0 - AccelPitch' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='delay' title='Késleltetés' cmdcolor='7895044' cmdcolor_sec='7895044' exp='100' type='1' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RS232' macro='Initialise' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='MPU6050' macro='Initialise' />
						<command class_type='calculation' title='Számítás' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='counter = 0' />
						</command>
						<command class_type='delay' title='Késleltetés' cmdcolor='7895044' cmdcolor_sec='7895044' exp='5' type='2' />
						<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='MPU6050' macro='SampleDevice' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='MPU6050' macro='GetAccelReading' >
									<return exp='Accel[0]' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='MPU6050' macro='GetAccelReading' >
									<return exp='Accel[1]' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='MPU6050' macro='GetAccelReading' >
									<return exp='Accel[2]' />
									<argument exp='2' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='MPU6050' macro='GetGyroReadng' >
									<return exp='Gyro[0]' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='MPU6050' macro='GetGyroReadng' >
									<return exp='Gyro[1]' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='MPU6050' macro='GetGyroReadng' >
									<return exp='Gyro[2]' />
									<argument exp='2' />
								</command>
								<command class_type='comment' title='' comment='Kommentár' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='ProcessAccelData' />
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='ProcessGyroData' />
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='ProcessFilterData' />
								<command class_type='calculation' title='Számítás' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='Disp_string = FloatToString$ (FilterPitch)' />
									<exp exp='//Disp_string = FloatToString$ (AccelPitch)' />
									<exp exp='//Disp_string = FloatToString$ (GyroPitch)' />
								</command>
								<command class_type='call' title='Komponens makró hívása' cmdcolor='1975743' cmdcolor_sec='1975743' component='RS232' macro='SendString' >
									<argument exp='&quot;FilterPitch:&quot;' />
								</command>
								<command class_type='call' title='Komponens makró hívása' cmdcolor='1975743' cmdcolor_sec='1975743' component='RS232' macro='SendString' >
									<argument exp='Disp_string' />
								</command>
								<command class_type='call' title='Komponens makró hívása' cmdcolor='1975743' cmdcolor_sec='1975743' component='RS232' macro='SendString' >
									<argument exp='&quot; &quot;' />
								</command>
								<command class_type='comment' title='' comment='Kommentár' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='calculation' title='Számítás' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='Disp_string = FloatToString$ (FilterRoll)' />
									<exp exp='//Disp_string = FloatToString$ (AccelRoll)' />
									<exp exp='//Disp_string = FloatToString$ (GyroRoll)' />
								</command>
								<command class_type='call' title='Komponens makró hívása' cmdcolor='1975743' cmdcolor_sec='1975743' component='RS232' macro='SendString' >
									<argument exp='&quot;FilterRoll:&quot;' />
								</command>
								<command class_type='call' title='Komponens makró hívása' cmdcolor='1975743' cmdcolor_sec='1975743' component='RS232' macro='SendString' >
									<argument exp='Disp_string' />
								</command>
								<command class_type='comment' title='' comment='Kommentár' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='calculation' title='Számítás' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='counter = counter + 1' />
								</command>
								<command class_type='call' title='Komponens makró hívása' cmdcolor='1975743' cmdcolor_sec='1975743' component='RS232' macro='SendString' >
									<argument exp='&quot; &quot;' />
								</command>
								<command class_type='call' title='Komponens makró hívása' cmdcolor='1975743' cmdcolor_sec='1975743' component='RS232' macro='SendString' >
									<argument exp='&quot;Counter:&quot;' />
								</command>
								<command class_type='call' title='Komponens makró hívása' cmdcolor='1975743' cmdcolor_sec='1975743' component='RS232' macro='SendNumber' >
									<argument exp='counter' />
								</command>
								<command class_type='call' title='Komponens makró hívása' cmdcolor='1975743' cmdcolor_sec='1975743' component='RS232' macro='SendChar' >
									<argument exp='13' />
								</command>
								<command class_type='delay' title='Késleltetés' cmdcolor='7895044' cmdcolor_sec='7895044' exp='100' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ProcessGyroData' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='GyroReal[0] = (FLOAT Gyro[0] * FLOAT GyroRes) * GyroTime' />
							<exp exp='GyroReal[1] = (FLOAT Gyro[1] * FLOAT GyroRes) * GyroTime' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='GyroRoll = GyroRoll + GyroReal[0]' />
							<exp exp='GyroPitch = GyroPitch + GyroReal[1]' />
							<exp exp='' />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='0' vmaj='2' codename='RS232' x='0.041287' y='0.520324' z='1.005' xsz='60' ysz='26' zsz='1.51' 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='cal_uart::CHANNEL' data='001' />
					<value target='BAUD_LIST' data='009' />
					<value target='BAUD' data='9600' />
					<value target='DBITS' data='008' />
					<value target='RETURN' data='000' />
					<value target='ToutVal' data='255' />
					<value target='FLOWEN' data='000' />
					<value target='ECHO' data='000' />
					<value target='cal_uart::TX' data='$PORTD.1' />
					<value target='cal_uart::TXAlt' data='0' />
					<value target='cal_uart::RX' data='$PORTD.0' />
					<value target='cal_uart::RXAlt' data='0' />
					<value target='cal_uart::OutputPins' data='007' />
					<value target='cal_uart::InputPins' data='013' />
					<value target='CTS' data='$PORTB.1' />
					<value target='RTS' data='$PORTB.2' />
					<value target='label' data='RS232' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='0' />
					<value target='ConsoleColumns' data='64' />
					<value target='DataSource' data='000' />
					<value target='com_port' data='005' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='75a362f4-d74d-48e7-9790-530f4d0e78b6' vmin='0' vmaj='1' codename='MPU6050' x='60' y='0' z='2.515' xsz='60.0001' ysz='26' zsz='1.51' 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='AddressBit' data='0' />
					<value target='GyroRange' data='000' />
					<value target='AccelRange' data='000' />
					<value target='CHANNEL' data='001' />
					<value target='SDA' data='$PORTC.4' />
					<value target='SCL' data='$PORTC.5' />
				</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='28' />
		<camera xe='-5.3779' ye='7.86963' ze='320.28' xt='-5.3779' yt='7.86963' 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='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAVQUAAGEDAAA' zoom='75' scrollx='0' scrolly='1439' flags='0' />
		<view type='0' name='ProcessGyroData' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAVQUAAGEDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ProcessAccelData' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAVQUAAGEDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ProcessFilterData' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAVQUAAGEDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
