Author Topic: Tilting Trigger on the Accelerometer  (Read 4011 times)

Nick_W

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: Tilting Trigger on the Accelerometer
« on: February 26, 2017, 04:51:22 pm »
I think that was more in the way of an example, normally you leave it on true, and you don't need to do any of the other stuff - dummy read, sleep etc, you just read GetAccel().

To explain the HP filter, when it is enabled, it removes the DC component (caused by gravity ie 1). This is what is then used by the interrupt routines (except orientation). So if you want an interrupt to trigger on acceleration of 0.5, with the hp filter on, gravity is ignored, and it triggers when the change of acceleration exceeds 0.5 (otherwise it would trigger all the time as acceleration due to gravity is 1.0).

If you read GetAccel(), you would read 0 for X,Y and Z, unless you were shaking the module or something.

So to get the real reading, you turn hpbypass on, now the readings from GetAccel() are the absolute values (including gravity). The interrupts are not affected, they still use the filtered values.

Anyway, I'll take a look tomorrow, and see what I can do.