how can we get a timer interrupt in a specific time or date? for example I want to make a project with UNO and I'm using sleep mode and the wake up source is timer2 as far as the ATMega328p datasheet. I want to turn on an led for example everyday on 3PM and the chip is on sleep in other times of the day. so how can I set the timer? I think I have to use CTC mode of timer2 and set the OCR amount but I'm not sure how to do it. There's a project on (Link) this link in Arduino site that is perfect for this project but when I compile it, gives me an error that cant be compile for UNO.enter image description here

  • Use an RTC chip. The Arduino timers have no concept of real time, only relative time, and that usually over very short periods. – Majenko Mar 25 at 15:52
  • Incidentally, that project uses an RTC that is built in to some of the more advanced (ARM) chips. – Majenko Mar 25 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.