Led Blink using Millis() Function

Hi, im having trouble working out the blinkwithout delay sketch.

How would i achieve this without using the delay function?

void setup() {                

 
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(500);              // wait for a second
  digitalWrite(13, LOW);    
  delay(500);              
  digitalWrite(13, HIGH);  
  delay(500);             
  digitalWrite(13, LOW);    
  delay(7000);              
}

You’ll want to vary the ‘interval’ value. Every time you write to the LED, you could change the interval value which will impact how long it waits before the next state change.

I am still new at this but, I think I have your code made.
sorry for the lack of colors,
Mark

unsigned long interval = 500;
unsigned long previousMillis = 0;
unsigned long currentMillis = 0;

void setup() {                


  pinMode(13, OUTPUT);     
}

void loop() {
  currentMillis = millis(); 
  previousMillis = currentMillis; // set the time counter: 

  while  (currentMillis - previousMillis < interval ){
    digitalWrite(13, HIGH);   // set the LED on
     currentMillis = millis(); 
  }
  interval = 800; // adjusting blink time for fun
  while  (currentMillis - previousMillis < interval ){
    digitalWrite(13, LOW);    
     currentMillis = millis(); 
  }
  interval = 700; // adjusting blink time for fun           
  while  (currentMillis - previousMillis < interval ){
    digitalWrite(13, HIGH);
     currentMillis = millis(); 
  }
  interval = 1500; // adjusting blink time for fun
  while  (currentMillis - previousMillis < interval ){             
    digitalWrite(13, LOW);   
    currentMillis = millis();  
  }              
}