0

I want to detect montion by accelerometer.I found on internet how to init sensor and how to read values. I read values with: Sensors.readSensor(Sensors.SENSOR_ACCELEROMETER, out);

But how can I use this values to detect montion.How can I detect LIFT UP,LIFT DOWN,MOVE RIGHT,MOVE LEFT,MOVE FORWARD,MOVE BACK,ROTATE LEFT,ROTATE RIGHT,SHAKE and other.

Filip
  • 68
  • 10

1 Answers1

0

Whenever the the position is changed, use

onSensorChanged(SensorEvent event)

using the event object you can fetch the changed values, and based on that you can decide you motion. Best example for motion detection can be found in the below link:

How can I get the direction of movement using an accelerometer?

Community
  • 1
  • 1
Zax
  • 2,870
  • 7
  • 52
  • 76