Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to decide the direction count that how much time device is rotated left, right, up or down ? #55

Open
dprajapati1179 opened this issue Feb 25, 2022 · 0 comments

Comments

@dprajapati1179
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant