Skip to first unread message

david corrio

unread,
Feb 7, 2016, 4:28:57 AM2/7/16
to MIT App Inventor Forum, dco...@gmail.com
Hello
i've build an app on Appinventor using the accelerometer
but in my app i can only use the accelerometer in rotation in the 3 axes, i would like to use the linear accelerometer because i need to measure linear speed
i still don't find how to, i hope someone can help me
thanks

Scott Ferguson

unread,
Feb 7, 2016, 6:19:57 AM2/7/16
to MIT App Inventor Forum, dco...@gmail.com
The best answer that I have found so far says basically don't use an accelerometer to measure distance, but he does provide a formula.
He also explains why it is difficult to measure distance with the accelerometer.
---
Happy Inventing!

david corrio

unread,
Feb 7, 2016, 1:33:00 PM2/7/16
to MIT App Inventor Forum, dco...@gmail.com
thanks scott for the answer
in the example you gave, he use linear accelerometer to calculte distance
but in Appinventor i didn't find how to use it, i've only find how to use rotation accelometer
anyone know how to use linear accelerometer?

Scott Ferguson

unread,
Feb 7, 2016, 2:33:23 PM2/7/16
to mitappinv...@googlegroups.com, dco...@gmail.com
If you look at my accelerometer tester app you will see that if you have the device faceup in your hand then lower your hand quickly, the acceleration value will drop toward 0.
That would be an example of what I think you are talking about.
Your starting acceleration value would be 9.8 m/sec^2 and ending would be 0.
The distance your hand travelled would be a function of the time it took from start to finish and those starting and ending acceleration values.
---
sf

david corrio

unread,
Feb 8, 2016, 4:00:25 AM2/8/16
to MIT App Inventor Forum, dco...@gmail.com
thanks again scott but my problem is still the same, in fact this accelemoter measure the x,y and z projection of the gravity, still not the linear acceleration
try this app https://play.google.com/store/apps/details?id=com.innoventions.sensorkinetics and u will see what i mean


Scott Ferguson

unread,
Feb 8, 2016, 6:26:32 AM2/8/16
to mitappinv...@googlegroups.com, dco...@gmail.com
Ther term 'linear acceleration sensor' just refers to the acceleration sensor in the device,
MITAI reads the exact same sensor values from the Android SDK in exactly the same way innoventions would.
What they do with that data afterward is anyone's guess unless they have published their software.
---
sf

david corrio

unread,
Feb 8, 2016, 11:38:55 AM2/8/16
to MIT App Inventor Forum, dco...@gmail.com
we can see in the documentation you gave that there is gravity sensor(TYPE_GRAVITY) and linear accelerometer sensor (TYPE_LINEAR_ACCELERATION) and this is this data i would like to read in Appinventor.
it is not the same sensor who give those 2 data
s
any idea how to read this data in appinventor?

Taifun

unread,
Feb 8, 2016, 2:23:59 PM2/8/16
to MIT App Inventor Forum
in case the built in accelerometer sensor does not help for your purposes,
you could write your own extension and create a block yourself...

more information about how to create an extension see here https://groups.google.com/d/msg/mitappinventortest/Ip2AX036d0U/5NJlAEbFCgAJ
however that will be more advanced and will require some Java skills...

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

Reply all
Reply to author
Forward
0 new messages