I have a timer circuit using a few buttons to control it, a nokia 5110 display and a AtMega328PU (and xtal & caps). To turn the timeroff I have used a longpress (2 sec) of input D2 using the Onebutton library:
attachInterrupt(0, pinInterrupt, LOW); set_sleep_mode(SLEEP_MODE_PWR_DOWN); sleep_enable(); sleep_mode();
Now i want to wake it up using a button press via interupt on pin D2, the same button as I use to put it to sleep. This is also the menu navigation button for Down. This is not the problem, I have managed to wake it up using
But when I only touch the button the timer wakes up again, how can I manage a wake up after a longpress (2 sec) on the button? This is a small timer the is going with me to the range in my rangebag, and I don’t want it to wake up if I shake my rangebag.
I also have a idle timer, it the timer is unused for one hour, it turns it self off to save power.
The circuit runs on two 1,5V AAA batteried and is pulling 6,2mA running and 17µA when sleeping, almost nothing…