Trying to get LEDs to blink while using temperature sensor

hello

I am trying to get LEDs to blink while using them to display temperature.

I am using an arduino uno.

const double temperaturePin = 0; 
double maxi = -100,mini = 100; 

void setup() 
{
  Serial.begin(9600);
  pinMode(2,OUTPUT);
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(6,OUTPUT);
  pinMode(7,OUTPUT);
  pinMode(8,OUTPUT);
  pinMode(9,OUTPUT);
  //initializes the digital pins as an output
}

void loop()  
{
  
  float voltage, degreesC, degreesF, degreesK;
  voltage = getVoltage(temperaturePin);
  degreesC = (voltage - 0.5) * 100.0; //formular for degreesC
  degreesF = degreesC * (9.0/5.0) + 32.0; //formular for degreesF
  degreesK = degreesC + 273.15; //formular for degreesK
  
  if(degreesC > maxi) {maxi = degreesC;} //updates max temp 
  if(degreesC < mini) {mini = degreesC;} //updates min temp 
  if(degreesC >= 5) {digitalWrite(2,HIGH);}
  if(degreesC >= 10) {digitalWrite(3,HIGH);}
  if(degreesC >= 15) {digitalWrite(4,HIGH);}
  if(degreesC >= 20) {digitalWrite(5,HIGH);}
  if(degreesC >= 26) {digitalWrite(6,HIGH);}
  if(degreesC >= 30) {digitalWrite(7,HIGH);}
  if(degreesC >= 35) {digitalWrite(8,HIGH);}
  if(degreesC >= 40) {digitalWrite(9,HIGH);}
  
  //turns the lights on and off depending on the temp
  
  Serial.print(degreesC);
  Serial.print((char)223); //to print the degrees symbol
  Serial.print("C, ");
  Serial.print(degreesF);
  Serial.print((char)223);
  Serial.print("F, ");
  Serial.print(degreesK );
  Serial.print((char)223);
  Serial.print("K -> ");
  Serial.print(maxi,DEC); //shows max temp
  Serial.print((char)223);
  Serial.print("C Max, ");
  Serial.print(mini,DEC ); //shows min temp
  Serial.print((char)223);
  Serial.println("C Min ");
  
  delay(5000); //waits 5 seconds before repeating code
}

float getVoltage(double pin)
{
  return (analogRead(pin) * 0.004882814);
}

Hi, welcome to the forum.

You have a "magic" number of 0.004882814 in your sketch. It is better to show what is going on, and let the compiler and the Arduino do the calcuation. The 'double' is not used in an Arduino Uno, you can use 'float' instead. A pin number is often an 'int', please do not use a floating point number for a pin number. It might not work.

float getVoltage ( int pin)
{
  return ( (float) analogRead ( pin ) / 1024.0 * 5.0 );
}

If you want to blink a led, and do other things at different times, you need to use millis() instead of delay(). Search for "Blink Without Delay", that shows the use of millis().