cancel
Showing results for 
Search instead for 
Did you mean: 

How to switch between movement and position detection using LIS3DH accelerometer?

SChau.21
Associate

Hi, I have a LIS3DH accelerometer which I have set up to detect movement by generating interrupt by setting the INT1_CFG register. I also want to detect the orientation of the accelerometer but I do not want both at the same time ( It would be great if I could detect both). I want to alternate between the settings so that when I go to sleep I turn on movement detection with interrupt enabled and when I wake up I want to disable the movement detection and check the orientation. When I switch from movement to position, the readings are all random and movement detection is still enabled. So far, I have not had any luck in doing both besides power cycling the accelerometer and manually changing the settings for each, which is not feasible in my case. I would appreciate any help regarding this.

Thank you.

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @SChau.2​ ,

for my understanding, do you want to do the following two actions, right?

  1. When in sleep mode, be able to perform movement detection;
  2. When in normal mode, be able to to perform orientation detection.

You don't want to manage the wake-up interrupt, am I correct?

Did you try to configure the LIS3DH for movement detection, then go in sleep mode, then resume from the sleep mote and configure the device for orientation detection?

I believe it is necessary to configure again the device when you switch from movement to position detection, since the two are concurrent register configurations on LIS3DH device...

-Eleon