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
ADXL362 to give interrupt on inactivity
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23911
- Joined: Mon Apr 21, 2008 2:33 pm
Re: ADXL362 to give interrupt on inactivity
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);
Please be positive and constructive with your questions and comments.