react-native-sensor-manager
react-native-sensor-manager copied to clipboard
How to decide the direction count that how much time device is rotated left, right, up or down ?
How to detect the direction when I move it (left, right, up and down)?
I installed react-native sensor npm install react-native-sensors --save.
**import { accelerometer } from "react-native-sensors";
const subscription = accelerometer.subscribe(({ x, y, z, timestamp }) => console.log({ x, y, z, timestamp }) );** I tested with the above code it works smoothly.
But, how can I detect the directions?
How can I detect the direction when I move it (left, right, up and down)?