Problem on Arduino Interrupt and RTC I am doing an experiment. In this experiment I want to start the RTC by presing the external Push Button which is connected with Aquino's pin 2 and take varites of action according to Time. For interrupt I have made a ISR and in this interrupt I wrote my main logic. But this things is not working.
The schematics is 

and The code is

`include &lt;Wire.h&gt;
#include "RTClib.h"
#include &lt;LiquidCrystal.h&gt;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 9);

RTC_DS1307 rtc;
int k = 0;
int led =13;
int pin =2;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};


void setup () {
 lcd.begin(16, 2);
 rtc.begin();
 Serial.begin(11520);
 pinMode(led,OUTPUT);
 pinMode(pin,INPUT);
 attachInterrupt(0, Time  , LOW);
  // Print a message to the LCD.
  if (! rtc.begin()) {
    lcd.print("hello, world!");
    while (1);
}

  if (! rtc.isrunning()) {
    Serial.println("RTC is NOT running!");
  }
}
void loop()
{}

void Time()
   {
    {DateTime now = rtc.now();
    lcd.setCursor(0, 0);
    lcd.print(now.year(), DEC);
    lcd.print("/");
    lcd.print(now.month(), DEC);
    lcd.print("/");
    lcd.print(now.day(), DEC);
    lcd.print(" ");
    lcd.print(daysOfTheWeek[now.dayOfTheWeek()]);
    int c = now.second();
    lcd.setCursor(0, 1);
    lcd.print(c);
    if(c==58)
      {
        k=k+1;
        lcd.setCursor(5, 1);
        lcd.print(k);
        if(k==4)
          {
            digitalWrite(led,HIGH);
            k=0;
          }
     }

    }}`


please help me.
Well, for example Arduino's delay needs interrupts to be working and as you may not know it's disabled inside of ISR handler.

Never ever use anything like while (1), delay(1000) and so on inside of ISR! And also do not reenable interrupts either! Set a simple volatile flag and use it inside of loop function instead.

Basically something like this:


constexpr int8_t button = 2;
volatile bool      flag = false;

void setFlag() {
  flag = true;
}

void setup() {
  pinMode(button, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(button), &amp;setFlag, FALLING);
}

void loop() {
  if (flag) {
    // it's running, you can do something here

    // and you can reset the flag here either
  }
  //delay(100); // if needed
}