Hey Wolfgang, thank you for sharing this lib! I'm currently playing with it and struggle with the checkInterrupt call on an ESP32 after put to deep sleep:
log_d("Setting up ADXL345...");
if (!myAcc.init())
{
log_d("ADXL345 not connected!");
}
if(myAcc.checkInterrupt(myAcc.readAndClearInterrupts(), ADXL345_ACTIVITY))
{
log_d("ADXL345 - Motion registered at: %s", myAcc.getActTapStatusAsString());
}
else
{
log_d("ADXL345 - No Motion registered");
}
myAcc.setCorrFactors(-230.0, 225.0, -227.0, 238.0, -280.0, 227.0);
myAcc.setDataRate(ADXL345_DATA_RATE_100);
myAcc.setRange(ADXL345_RANGE_2G);
myAcc.setActivityParameters(ADXL345_AC_MODE, ADXL345_XYZ, 0.0675);
myAcc.setInterrupt(ADXL345_ACTIVITY, INT_PIN_1);
myAcc.readAndClearInterrupts();
The ADXL345 is always powered on and should register movement and save it until the esp wakes up again and pulls the state and resets that interrupt. Am I doing it totally wrong or am I missing something here?