I need to detect a change from 1 to 0 that could happen in a Snooze deepSleep or it could happen outside of it in loop(). I'm not sure if an interrupt would play nice with Snooze and the interrupt itself may take a few days to happen so its kind of hard to test. This is my first time trying an interrupt on Teensy or Arduino so any pointers would be greatly appreciated.
before set up:
volatile bool testDone = FALSE; // only has to go low once (testDone==TRUE), it is never reset
void BatEOC(void) {
testDone = TRUE;
}
in setup():
pinMode(0, INPUT); // test point provides pull up source
attachInterrupt(digitalPinToInterrupt(0), BatEOC(), FALLING);
I will check for (testDone == TRUE) as part of my code in loop(), timing is not critical. loop() takes about 5 seconds with all the deepSleep's. As long as it catches it I'm good.
Am I missing anything thing that could cause issues?
before set up:
volatile bool testDone = FALSE; // only has to go low once (testDone==TRUE), it is never reset
void BatEOC(void) {
testDone = TRUE;
}
in setup():
pinMode(0, INPUT); // test point provides pull up source
attachInterrupt(digitalPinToInterrupt(0), BatEOC(), FALLING);
I will check for (testDone == TRUE) as part of my code in loop(), timing is not critical. loop() takes about 5 seconds with all the deepSleep's. As long as it catches it I'm good.
Am I missing anything thing that could cause issues?
Last edited: