- Wed Jun 28, 2017 1:23 pm
#195324
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:
Have you seen a proper way to handle adxl345 with interrupts and sleep?
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:
Code: Select all
It looks like internal buffer is filling ... so I put FIFO to bypass mode during setup().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
Code: Select all
but it did not help.... setRegisterBit(ADXL345_FIFO_CTL, 7, 0);
setRegisterBit(ADXL345_FIFO_CTL, 6, 0);
Have you seen a proper way to handle adxl345 with interrupts and sleep?