react-native-sensor-manager icon indicating copy to clipboard operation
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 ?

Open dprajapati1179 opened this issue 2 years ago • 0 comments

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)?

dprajapati1179 avatar Feb 25 '22 06:02 dprajapati1179