How to use the expo-sensors.Gyroscope.setUpdateInterval function in expo-sensors

To help you get started, we’ve selected a few expo-sensors examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github janaagaard75 / expo-and-typescript / src / GyroscopeScreen.tsx View on Github external
private useLongUpdateInterval() {
    Gyroscope.setUpdateInterval(1000);
  }
github janaagaard75 / expo-and-typescript / src / GyroscopeScreen.tsx View on Github external
private useShortUpdateInterval() {
    const framesPerSecond = 60;
    Gyroscope.setUpdateInterval(1000 / framesPerSecond);
  }
github byCedric / use-expo / packages / sensors / src / use-gyroscope.ts View on Github external
useEffect(() => {
		if (availability) {
			Gyroscope.isAvailableAsync().then(setAvailable);
		}

		if (options.interval !== undefined) {
			Gyroscope.setUpdateInterval(options.interval);
		}

		return Gyroscope.addListener(setData).remove;
	}, []);