Hi
I just bought the wake-on-shake and,
I do have the exact same comment that the first person made on this post:
https://www.sparkfun.com/products/11447 … 1614800128
I would like to have “a remote control that sleeps until you pick it up, and stays powered until you put it down”.
And of course, your board does not do this,
" what they actually do is wake up for a preset period of time when accelerated, and then remove power after this time has passed".
As suggested in the post,
the solution proposed is to include a check in my main coding body but, this is not very elegant and simply don’t apply to my case. (I am lopping endlessly, meaning that it would be always on…)
And
I simply don’t understand why by default you board does not do this!
This objective of the board is to stay “wake” as long as there are movements.
Anyway
Would it be possible to have a full coding example that implement the “AWAKE flag” byte 6 check to leave my projet “On” untill that are no movement (and not based on a “preset time”)?
There is a nice person that did this (in the post in “c” language) but only a portion of this solution is in the post, it is incomplete
and
this implenattion is not for Arduino developers like me?
Thank in advance.
Ref;
ISR(TIMER1_OVF_vect)
{
// Check if accelerometer is still awake
uint8_t statusByte = (uint8_t)ADXLReadByte((uint8_t)XL362_STATUS);
if ((statusByte & (1 << 6))) {
TCNT1 = t1Offset; // Reset the timer
} else {
sleepyTime = TRUE;
}
}