Hello,
I am trying to get my arduino to sleep and wake up on event from adxl345. So far so good->that part was easy.
But…
I can do that only once or twice and then my device hungs completely.
Unless i od that constantly:
interrupts = adxl.getInterruptSource();
do {
//Activity
if (adxl.triggered(interrupts, ADXL345_ACTIVITY)) {
Serial.println("*** ACTIVITY ***");
bb(); //blink
adxl.get_Gxyz(xyz);
}
interrupts = adxl.getInterruptSource();
Serial.println ("Interrupts="+(String)interrupts);
} while (interrupts != 0); //never true
It looks like internal buffer is filling … so I put FIFO to bypass mode during setup().
setRegisterBit(ADXL345_FIFO_CTL, 7, 0);
setRegisterBit(ADXL345_FIFO_CTL, 6, 0);
but it did not help…
Have you seen a proper way to handle adxl345 with interrupts and sleep?