Discussion about Cancelling Alert message temporarily/permanently and about using sensors to detect sudden increase in speed after short term rest or less movement?

I think, by using the above blocks, we can detect when the phone is not shaking as well. Il try.

Can I predict if the values of accelerometer goes up or down from the current value? If the value goes up/down (+3 or -3 ) from the current value, then play music.

I tried these blocks, But, this is not working, guide me,

I do not believe that is possible

Sorry, all your Blocks in the if statements are wrong and meaningless.

1 Like

When I tried to compare the x, y and z to know if x is smaller, the blocks are not working,

Will it work if we make the x, y, z as global variables and then try to know which value is smaller? Il get time at night, will expeiment it at that time. Will try by including TinyDB as well.

This possibly will work for you.


accelerratorAlarm.aia (48.7 KB)

The simple acceleration example app recognizes Tilting up and down and left/right using the x and y accel. No need to use z axis and compare it to any other axis. Plays a sound when acceleration is within specific values.

Experiment with to make it perform as you want.

1 Like

Okay, may I know

When phone position is LEFT, which value (x or y or z) will raise during movement like forward and backward?

You tried and experimented with the app, so you probably already figured this out.

  • when phone is tilted LEFT (red) x axis acceleration is providing negative values.

  • when phone is tilted RIGHT (green) x axis acceleration is providing positive values

  • when phone top is tilted up (light red) y axis acceleration is providing positive values
    -when the phone phone top is tilted down (cyan) y axis acceleration is providing negative values.

  • when no markers are shown the phone is probably resting on a table top (the triggering acceleration is not in the range programed).

  • both Right and Tilt Up or down and Left and Tilt Up or down display simultaneously when the accelerometer recognizes both x and y acceleration positive or negative values at the same time. Notice that the two sound files play together when this happens.

1 Like

Can we introduce clock within this app?. ie, If the phone stays in LEFT for 10 seconds, then play music (or do any given task).

Can we merge orientation sensor as well, so it may be possible to distinguish the movement value of accelerometer from tilt value.

ie, If 'orientation sensor & Accelerometer sensor' = LEFT, then the exceeded accelerometer value is Movement value/acceleration value. ie, both sensors may match in showing the position/tilt of the phone but accelerometer shows extra value, that is what 'Acceleration Value'. I am speaking in imagination but it may be possible?.

So, HOW CAN WE MODIFY THE SAME APP (AccelerometerAlarm) to say left, right etc. for orientation sensor as well.

...by adding an Orientation sensor


and adding labels 5,6 and 7 to l handle roll (left/right tilting).

you can code pitch and sounds yourself.

1 Like

Capture

When I tried this, the 'Not Shaking' block is not working. Can you guide me?

Did you start the clock timer ?

start means enabling it, am I right?

blocks (55)

Okay, now it is working.

Which sensor will be helpful to know if the phone is kept within pocket (Shirt or Pant)?

This app is working fine only if these two blocks (related to pedometer) are disabled, may I know why? But, I need these two blocks as well.

The Pedometer component uses the accelerator hardware in your phone.

Pedometer

This component keeps count of steps using the accelerometer.

so it is probable BOTH a Pedometer and Accelerometer component cannot be use simultaneously in an App Inventor app.

1 Like

But, here both sensors are working together without error/faults. So, is there any possibility to solve the error of the above app.

deleted