Hello everyone in the MIT App Inventor community!
After the chronometer that now is working perfectly I decided to create and inclinometer, (which I think will be used for a future game).
I want to give three values X, Y and Z:
X = inclination towards North and South
Y = inclination toward West and East
Z is the value against gravity that is upwards and downwards. I don’t know how to be more specific but for example when we put the phone on the table the X and Y are 0 and the Z value is 9,81 or something around that. This is because there is an acceleration of 9,807 m/s2 on the Earth which is the gravity found on our planet. I have never used an Accelerometer Sensor and I would like to know how to work with it and how to make it useful.
From this programme I want the values that are for X when Y when the device is inclined in a certain direction.
Thank you for your attention and your help!
1 Like
Sorry these are the correct explanation found in the sensors page:
http://ai2.appinventor.mit.edu/reference/components/sensors.html#AccelerometerSensor
- xAccel : 0 when the phone is at rest on a flat surface, positive when the phone is tilted to the right (i.e., its left side is raised), and negative when the phone is tilted to the left (i.e., its right size is raised).
- yAccel : 0 when the phone is at rest on a flat surface, positive when its bottom is raised, and negative when its top is raised.
- zAccel : Equal to -9.8 (earth’s gravity in meters per second per second when the device is at rest parallel to the ground with the display facing up, 0 when perpendicular to the ground, and +9.8 when facing down. The value can also be affected by accelerating it with or against gravity.
1 Like
There is advice in some of the following links https://community.appinventor.mit.edu/search?q=Accelerometer
How to display the the values that are for X when Y when the device is inclined in a certain direction.
To create an inclinometer, you might have more success using the Orientation sensor which is designed to display pitch and roll of the Android (tilting to left and right or up or down). These might be more useful
1 Like
Thank you for the advice!
1 Like
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.