예제 #1
0
/*
 * Wrapper Function of getMagValue. It waits until the ADC completes the conversion.
 *
 */
double AD5933_Class::getMagOnce()
{
	while (!isValueReady()) // wait until ADC conversion is complete.
	{
		//delay(delayTimeInit);
		;
	}
	return getMagValue();
}
예제 #2
0
파일: AD5933.cpp 프로젝트: HugoSBIO/drive
double AD5933_Class::getMagOnce()
// Wrapper Function of getMagValue. It waits until the ADC completes the conversion.
{
	while (!isValueReady()) // wait until ADC conversion is complete.
	{
		//delay(delayTimeInit);
		;
	}
	return getMagValue();
}
예제 #3
0
int main(){

	//wiringPi check
	showError();
	// ctl + c ...exiting
	(void)signal(SIGINT,control_event);
	(void)signal(SIGQUIT,control_event);

	//gnuplot file
	gnuPlotOpenfile();

	//sensor initial
	sensorInit();

	printf("....start loop....\n");
	while(1) {
		//accel
		getAccelValue();
		accelCalculate();
		//gyro
		getGyroValue();	
		gyroCalculate();	
		//mag		
		getMagValue();
		//baro		
		getBaroValue();

		//filter
		sensorFilter( pitchRatio, rollRatio, yawRatio, altitudeRatio );

		//put data to file
		gnuPlotPutToFile(dataNum);	

		printResult();
		delay(10);//+40(in getTempValue)....sampling time
		dataNum++;
	}
}