ADXL362 to give interrupt on inactivity

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
arnom
 
Posts: 26
Joined: Fri Nov 15, 2013 1:40 pm

ADXL362 to give interrupt on inactivity

Post by arnom »

Hi,

I want to have my ADXL362 to send an interrupt signal to my Arduino when it has not moved for a number seconds (let's say 4 seconds).
Once this interrupt has fired, it should only send another interrupt after the motion was detected and the accelerometer has not moved for 4 seconds since that motion.

I had a look at the Arduino library bij Anne Mahaffey, which includes an example for motion activation.
Unfortunately I did not manage to find out the correct register settings to achieve what I want.
Can anyone point me in the right direction?

Kind regards,
Arno

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: ADXL362 to give interrupt on inactivity

Post by Franklin97355 »

It looks like this code is setting the registers

Code: Select all

    //
    // Setup ADXL362 for proper autosleep mode
    //
	
    // Map Awake status to Interrupt 1
    // *** create a function to map interrupts... coming soon
    xl.SPIwriteOneRegister(0x2A, 0x40);   
	
    // Setup Activity/Inactivity register
    xl.SPIwriteOneRegister(0x27, 0x3F); // Referenced Activity, Referenced Inactivity, Loop Mode  
        
    // turn on Autosleep bit
    byte POWER_CTL_reg = xl.SPIreadOneRegister(0x2D);
    POWER_CTL_reg = POWER_CTL_reg | (0x04);				// turn on POWER_CTL[2] - Autosleep bit
    xl.SPIwriteOneRegister(0x2D, POWER_CTL_reg);

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”