Im building a project that needs to be energy efficient since it runs on batteries.
I need a timer to start and count up to 45 seconds that will put the arduino in sleepmode using a CTC interrupt.
When there is interaction during the time counting up to 45 seconds it needs to reset the timer to zero. My problem is that I don't know how to start and stop a timer. I have only worked with timers that are constantly on.
After it goes back to sleep mode the timer will be disabled and I need to turn it back on as soon as an external interrupt wakes up the arduino.
Can you tell me how to stop and start a timer?
Thank you in advance