Need correct coding for Arduino IDE program to execute the following:
EXERCISE 1: DISPLAYING TIME ON PUSHBUTTON INTERRUPT
You will need to understand how interrupts are attached to digital pins in the UNO. Here is a good reference with examples: attachInterrupt()
You will find that only digital pins 2 and 3 can be attached to an interrupt in the UNO.
Wire a pushbutton and the real time clock to the UNO board using the breadboard. Ensure that you have connected the button to a pin that can be attached to an interrupt. Write code to send values 5, 10, 15 .. 50, to the serial monitor at 5 second interval, in a new line. If you open the serial monitor, it should display values 5, 10, and so on, up to 50 and then start at 5 again. Next, add code to attach the interrupt to the pushbutton. In the interrupt routine, simply read the time and date value from the RTC and display it in the serial monitor. Download the new sketch. The numbers display will go on exactly as before in the serial monitor. However, every time you push the button, a line giving the current date and time will display in the serial monitor window. You have learned to execute two tasks together.