yes, you can find it out by experimenting or you also could take a look into the documentation...
https://ai2.appinventor.mit.edu/reference/components/sensors.html#AccelerometerSensor
Taifun
yes, you can find it out by experimenting or you also could take a look into the documentation...
https://ai2.appinventor.mit.edu/reference/components/sensors.html#AccelerometerSensor
Taifun
May I know why accelerometer sensor is also functioning like orientation sensor, ie, If I change the position/angle of phone, both sensors are showing some fixed values (even if the phone is fixed somewhere without giving any further movement). But, I expexted that accelerometer will give values based on how fast the device is moved in x or y or z axis. Right now, I can't find differences between both sensors, Both sensors are giving some fixed values for each phone position/angle.
MY EXPECTATION:
Accelerometer sensor must be in 0 (or some initial value) when it is in rest regardless of the phone's position or angle. Now, when the phone moved in any angle, the value of that angle must go up. This is what I expected.
Or else, how can I do this using accelerometer?
Check all the x values of accelerometer for 5 seconds & Find the average of all those values.
Repeat step 1 again.
Compare and check step 1 value and step 2 value. If Step 1 value < Step 2 value, then 'SPEED INCREASED'.
So, in 10 seconds we can give audio-alert to the driver as 'You Started Driving'.
How can I loop the 'Orientation sensor block' and 'Accelerometer sensor block', so they will check the changes each other and perform accordingly consistently.
Right now the blocks within acceleromer block are functioning only one time without repetition. ie, these blocks are not going back and checking the players named as player5Roll and player5Pitch.
Help me to do this,
If phone's position is in favor to accelerometer's x value then proceed with x value - To detect the speed change.
If phone's position is in favor to accelerometer's y value then proceed with y value - To detect the speed change.
That is what I tried in above blocks as a newbie.
See the answers here
Taifun
I guess, the blocks that I shared recently is closer to the result. Please, look at it and give your ideas as well.
Update: Im getting result now as expected but with some errors, ie, the x and y values are getting stuck (not updating new values). This may be because of fault in clock arrangements or something else, have a look and guide me.
Accelerometer shows fixed value when we tilt the phone in different position. So, it is difficult to depend this sensor to check the speed/movement-spikes. Because, same x,y,z reading for phone tilt and phone movement. How can we differentiate the readings between phone tilt and phone movement? There is no option for that.
In case of orientation sensor, the readings will be shown only for phone tilt. But, in accelerometer sensor both values are confused and mixed/merged each other, we cannot differentiate the values as when the sensor shows reading for phone tilt and when it shows reading for phone movement. If there is a way to differentiate Phone Movement using accelerometer sensor, please share the idea here.
Is there a way to compare current accelerometer values with past accelerometer values?
Keep copies of the values somewhere.
Is there predefined values for accelerometer sensor for different phone positions? Is there any table for that?
No predefined values since accelerometers are hardware based, ranges of measurement are determined by what hardware a manufacturer includes in a device.
As a rule of thumb,
Why not experiment with your phone?
. What Google says:
Yes, I am experimenting with my phone.
@SteveJG But, how can I create an app that differentiate tilt value and movement value using accelerometer, because accelerometer shows both value (ie, value for tilt and movement) without distinguishing both values. I wish to distinguish both.
That Google article was very informative a about this problem, especially when they talk about calibration and the use of high pass filtering.
Get out your math muscles
Distinguish both.
For other methods to determine constant movement
I think, by using the above blocks, we can detect when the phone is not shaking as well. Il try.