const int led = 13;
const int button = 2;

volatile unsigned long debounce_delay = 1000;
volatile int dodatak = 4000;

volatile bool led_state = false;
volatile unsigned long interval = 0;
unsigned long previous_time = 0;

void setup() {
  pinMode(led, OUTPUT);
  pinMode(button, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(button), toggleLED, FALLING);
  Serial.begin(9600);
}

void loop() {
  unsigned long current_time = millis();
  if (current_time - previous_time >= 1000 && current_time - previous_time < 5000) { // 1s interval
    debounce_delay = 1000;
  } else if (current_time - previous_time >= 5000 && current_time - previous_time < 10000) { // 5s interval
    debounce_delay = 5000;
  } else if (current_time - previous_time >= 10000) { // 10s interval
    debounce_delay = 10000;
    previous_time = current_time; // update the previous time
  }
  
  if (current_time - interval >= debounce_delay){
    led_state = !led_state;
    digitalWrite(led, led_state ? HIGH : LOW);
    interval = current_time;
  }
}

void toggleLED(){
  debounce_delay = 2 * debounce_delay;
}