Skip to content

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

@dprajapati1179

Description

@dprajapati1179

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions