Android Question Accelerometer values without gravity

grazianod

Member
Licensed User
Longtime User
hello, do you know how get accelerometer values without gravity?
if i use the example, values are with gravity level; i need this value without gravity

thanks guys for your help
 

grazianod

Member
Licensed User
Longtime User
Thanks Erel, but where i have to pass "10" value? usualy i use "AddSensor(ps.TYPE_ACCELEROMETER, "ACCELEROMETER", True)" in the activity_create
 
Upvote 0

grazianod

Member
Licensed User
Longtime User
Instead of ps.TYPE_ACCELEROMETER.
thanks Erel, it works, but probably my question was not so exact.
Whit this values i have a data similar to ROTATION_VECTOR and not a real G-force (if i move the device 40-50 degree on the left or right, the x or z values changes but after the real acceleration when i stop the device, values must go to "0" if device is stopped i must have "0"... no mouvment and no g-force)
do you know how i can get this values?
thanks and sorry for my question not so accurate
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I think that this is the sensor you are looking for.

This is what I get when there is no movement:

SS-2017-10-25_13.34.54.png


The values are not 0 but are not far from it. The phone accelerometers are not very accurate.
 
Upvote 0

grazianod

Member
Licensed User
Longtime User
I think that this is the sensor you are looking for.

This is what I get when there is no movement:

SS-2017-10-25_13.34.54.png


The values are not 0 but are not far from it. The phone accelerometers are not very accurate.
thanks! the 3rd value of linear_accelerometer is what i need.
great support!
 
Upvote 0
Top