void orient_init() {

	os_printf("Initializing accelerometer...\n");
	accelerometer_start();

	os_printf("Initializing gyro...\n");
	gyro_start();

	updateinterval = 0;
}
Beispiel #2
0
void RotateHelper::start(int timeinms)
{
	// remember where we were when we started
	QValueSpaceItem vsiRot("/UI/Rotation/Current");
    initial_rotation= vsiRot.value().toUInt();
	
	// don't allow multiple timers to run
	if(timer != NULL){
		stop();
	}

	// start accelerometer
	accelerometer_start(timeinms, NULL, NULL);

	// start up a single shot timer to check accelerometers
	// it will be restarted each time
	timer = new QTimer(this);
	connect(timer, SIGNAL(timeout()), this, SLOT(sample()));
	timer->start(timeinms);
}