int LED=8;//Pin Led (Attiny44 pin 5 = Arduino pin 8 ) int BUTTON=3; //Pin Button (Attiny pin 10 = Arduino pin 3). unsigned long previousMillis = 0; // will store last time LED was updated unsigned long interval = 100; // interval at which to blink (milliseconds) int previousButtonState=1; int ButtonState=1; int ledState = LOW; // ledState used to set the LED // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED, OUTPUT); pinMode(BUTTON,INPUT); interval=100; } // the loop function runs over and over again forever void loop() { //Controller BUTTON ButtonState = digitalRead(BUTTON); // check if the pushbutton is pressed. If it is, the buttonState is HIGH: if (ButtonState !=previousButtonState) { previousButtonState=ButtonState; if(ButtonState==0){ if(interval>1){ interval=interval/2; }else{ interval=100; } } } ///Controller LED unsigned long currentMillis = millis(); if (currentMillis - previousMillis >= interval) { // save the last time you blinked the LED previousMillis = currentMillis; // if the LED is off turn it on and vice-versa: if (ledState == LOW) { ledState = HIGH; } else { ledState = LOW; } // set the LED with the ledState of the variable: digitalWrite(LED, ledState); } }