blinker coding

 // Mygtuko kontaktas
const int buttonPin = 7;

// LED kontaktai
const int LED1 = 13;
const int LED2 = 12;




int LED1Status = LOW;
int LED2Status = LOW;

int buttonState;

unsigned long timePress = 0;
unsigned long timePressLimit = 0;
int clicks = 0;

void setup() {
 
  pinMode(buttonPin ,INPUT_PULLUP);
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  Serial.begin(9600);
}

void loop() {
 
    buttonState = digitalRead(buttonPin);
 
  if (buttonState == LOW){
    delay(200);
    //Serial.println("Paspaustas");
   
    if (clicks == 0) {
    timePress = millis();
    timePressLimit = timePress + 1000;   
    clicks = 1;
    }

    else if (clicks == 1 && millis() < timePressLimit){
      //Serial.println("Paspaustas du kart");
     
     //Double click veiksmas
     if (LED2Status == LOW){  //jei LED2 isjungtas tai prades mikseti
          
      digitalWrite(LED2, HIGH);
      LED2Status = HIGH;     //statusas pasikeicia i mirksincio
     }

     else if (LED2Status == HIGH){   //jei statusas mirksincio tuomet isjungia
      digitalWrite(LED2, LOW);
      LED2Status = LOW;
     }   
      if (LED1Status == HIGH){  //apsauga kad neveiktu abu vienu metu, jei paspaudus du kartus dar vis mirksi LED1 ji isjungs.
         digitalWrite(LED1, LOW);
        LED1Status = LOW;
      }
     
      timePress = 0;
      timePressLimit = 0;
      clicks = 0;     
    }   
  }

  if (clicks == 1 && timePressLimit != 0 && millis() > timePressLimit){
     //Serial.println("Viena karta paspaustas");
     timePress = 0;
     timePressLimit = 0;
     clicks = 0;

     //One click veiksmas
     if (LED1Status == LOW){
      
      digitalWrite(LED1, HIGH);
      LED1Status = HIGH;
     }

     else if (LED1Status == HIGH){
      digitalWrite(LED1, LOW);
      LED1Status = LOW;
     }
     if (LED2Status == HIGH){
       digitalWrite(LED2, LOW);
       LED2Status = LOW;
     }
  
  }
}

I set button for 2 functions. But its only turn on leds. Can someone say how to code led’s to blink?

Look at the BlinkWithoutDelay example sketch.

I tryd to insert the code. But led just staying on...

Maybe a bit of a boring answer, but as there this code has many ifs, elses and elseifs: Have you tried using serial.println to figure out what blocks are being ran and which arent?

My guiss is that if you know the order things are run in, you’ll know if it behaves as you intended when programming. If conditions you assume to be true, actually are true, etc.

thorcustomgarage:
I tryd to insert the code. But led just staying on...

Then show us that code, otherwise we have to guess what you did.

// Mygtuko kontaktas
const int buttonPin = 7;

// LED kontaktai
const int LED1 = 13;
const int LED2 = 12;
unsigned long previousMillis = 0;
const long interval = 300;


int LED1Status = LOW;
int LED2Status = LOW;

int buttonState;

unsigned long timePress = 0;
unsigned long timePressLimit = 0;
int clicks = 0;

void setup() {
 
  pinMode(buttonPin ,INPUT_PULLUP);
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  Serial.begin(9600);
}

void loop() {
 unsigned long currentMillis = millis();
    buttonState = digitalRead(buttonPin);
  if (buttonState == LOW){
    delay(200);
    //Serial.println("Paspaustas");
   
    if (clicks == 0) {
    timePress = millis();
    timePressLimit = timePress + 1000;   
    clicks = 1;
    }

    else if (clicks == 1 && millis() < timePressLimit){
      //Serial.println("Paspaustas du kart");
     
     //Double click veiksmas
 
     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 (LED2Status == LOW) {
      LED2Status = HIGH;
    } else {
      LED2Status = LOW;
    }

    // set the LED with the ledState of the variable:
    digitalWrite(LED2, LED2Status);
     }   
           
      timePress = 0;
      timePressLimit = 0;
      clicks = 0;     
    }   
  }

  if (clicks == 1 && timePressLimit != 0 && millis() > timePressLimit){
     //Serial.println("Viena karta paspaustas");
     timePress = 0;
     timePressLimit = 0;
     clicks = 0;

     //One click veiksmas
      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 (LED1Status == LOW) {
      LED1Status = HIGH;
    } else {
      LED1Status = LOW;
    }

    // set the LED with the ledState of the variable:
    digitalWrite(LED1, LED1Status);
     }
  
  }
}

this is my first project with arduino, so please be patient :))