Hi, I'm also interested in this functionality and wondered if there is any sample code available?
btw I have this working via the following code
the setup() code for the interrupt - note the use of FALLING is so the rtc.standbyMode() triggers
pinMode(1, INPUT_PULLDOWN); //BMA raises pin high on interrupt
attachInterrupt(digitalPinToInterrupt(1), BMAInterrupt, FALLING); // try RISING?
The interrupt routine itself - bare bones
void BMAInterrupt()
{
motionInterrupt = true; // flag motion
}
And the code for initialising interrupt for 'any motion' which is added to the begin() routine
// set the interrupt mode - this is temporary 500 usec
// note we don't not latched the interrupt
Wire.beginTransmission(I2Caddress);
Wire.write(0x21); // interrupt mode - see page 23 of the spec
Wire.write(0x09);
Wire.endTransmission();
// enable slope interrupts - used for 'any motion' detection
Wire.beginTransmission(I2Caddress);
Wire.write(0x16);
Wire.write(0x07);
Wire.endTransmission();
// Map slope interrupt to pin 1
Wire.beginTransmission(I2Caddress);
Wire.write(0x19);
Wire.write(0x04);
Wire.endTransmission();
// Use 4 samples for the slope interrupt - threshold duration
Wire.beginTransmission(I2Caddress);
Wire.write(0x27);
Wire.write(0x02); // reduce to 3 from 4
Wire.endTransmission();
// And set slope threshold
Wire.beginTransmission(I2Caddress);
Wire.write(0x28); // slope threshold
Wire.write(0x14); // note this is the default value - see page 47 of the spec
Wire.endTransmission();