Beispiel #1
0
void imuPrintInfo( void* handle )
{
	if( !handle )
		return;

	CPhidgetHandle phid = (CPhidgetHandle)handle;

	int serialNo = 0;
	int version = 0;
	const char* ptr;
	int numAccelAxes = 0, numGyroAxes = 0, numCompassAxes = 0;
	int dataRateMax = 0, dataRateMin = 0, dataRateCurr = 0;

	//CPhidget_getDeviceType(phid, &ptr);
	//printf("IMU  %s\n", ptr);

	CPhidget_getSerialNumber(phid, &serialNo);
	CPhidget_getDeviceVersion(phid, &version);
	CPhidgetSpatial_getAccelerationAxisCount((CPhidgetSpatialHandle)phid, &numAccelAxes);
	CPhidgetSpatial_getGyroAxisCount((CPhidgetSpatialHandle)phid, &numGyroAxes);
	CPhidgetSpatial_getCompassAxisCount((CPhidgetSpatialHandle)phid, &numCompassAxes);
	CPhidgetSpatial_getDataRateMax((CPhidgetSpatialHandle)phid, &dataRateMax);
	CPhidgetSpatial_getDataRateMin((CPhidgetSpatialHandle)phid, &dataRateMin);
	CPhidgetSpatial_getDataRate((CPhidgetSpatialHandle)phid, &dataRateCurr);
	
	
	printf("IMU  Serial Number: %10i\n", serialNo);
	printf("IMU  Version: %8i\n", version);
	printf("IMU  Number of Accel Axes: %i\n", numAccelAxes);
	printf("IMU  Number of Gyro Axes: %i\n", numGyroAxes);
	printf("IMU  Number of Compass Axes: %i\n", numCompassAxes);
	printf("IMU  datarate>   Min: %d  Max: %d  Current: %d\n", dataRateMin, dataRateMax, dataRateCurr);
}
Beispiel #2
0
 int Spatial::getDataRate()
 {
     int milliseconds;
     CPhidgetSpatial_getDataRate(spatial_handle_, &milliseconds);
     return milliseconds;
 }