Love-o-meter turned thermometer

I am trying to make the stock "love-o-meter" into a thermometer for my room, But i am having trouble adding a 5th LED to the code. I have 3 LED's for above 22 c, above 24 c, and above 26 c and one for below the baseline of 20c. When i try to add a 5th LED to light up above 28 c it won't work. The LED is fine i testen both the pin and the LED with the "blink" program and they both worked. I just got the startet kit for christmas so i'm not that good with the coding.

Here's the code i use.

const int sensorPin = A0;
const float baselineTemp = 20;

void setup () {
Serial.begin(9600);
for(int pinNumber = 2; pinNumber<7; pinNumber++){
pinMode(pinNumber, OUTPUT);
digitalWrite(pinNumber, LOW);
}
}
void loop() {
int sensorVal = analogRead(sensorPin);
Serial.print("Sensor Value: ");
Serial.print(sensorVal);
float voltage = (sensorVal/1024.0) * 5.0;
Serial.print(", Volts: ");
Serial.print(voltage);
Serial.print(", degrees C: ");
float temperature = (voltage - .5) * 100;
Serial.println(temperature);

label:
if(temperature < baselineTemp){
digitalWrite(6, LOW);
digitalWrite(5, HIGH);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
delay(500);
digitalWrite(5, LOW);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
delay(500);
goto label;

}else if(temperature >= baselineTemp+2 && temperature < baselineTemp+4){
digitalWrite(6, LOW);
digitalWrite(5, LOW);
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}else if(temperature >= baselineTemp+4 && temperature < baselineTemp+6){
digitalWrite(6, LOW);
digitalWrite(5, LOW);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
}else if(temperature >= baselineTemp+6){
digitalWrite(6, LOW);
digitalWrite(5, LOW);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
}else if(temperature > baselineTemp+8){
digitalWrite(6, HIGH);
digitalWrite(5, LOW);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
}
delay(1);
}

Welcome to the forum. When you have a moment please read the post at the to of the page, 'How to use this forum', which includes how to post your code.

Look at the line

}else if(temperature >= baselineTemp+6){

and compare to the earlier comparisons.

Shouldn't it be

}else if(temperature >= baselineTemp+6 && temperature < baselineTemp+8){?

*Not acording to page 51 in the "arduino projects book" but that's not the LED that won't work. i tried just changing the "}else if(temperature >= baselineTemp+6){" to "}else if(temperature >= baselineTemp+8){" which worked but then i don't have an indicator for above 26c. It just seems so wierd to me that the last LED wont work, even tho the pin, the cable and the led are all fine.

And yeah, i found the 'How to use this forum', after i posted so that my bad.

think of a else if the way the arduino see's it

if this is true then I don't test the rest I just skip them.

if this is false I test the next if. if this is true then I don't test the rest I just skip them.

etc etc

it does this all the way down the code

now else if(temperature >= baselineTemp+6){

ok if its 8 degrees bigger then this is true so it will never test else if(temperature > baselineTemp+8){ as it already found a if that was true.

now you could re-arrange the order the if's are read so it tests the highest one first

if(temperature > baselineTemp+8){ }
then
else if(temperature >= baselineTemp+6){ }
and it will work

label:
if(temperature < baselineTemp){
  digitalWrite(6, LOW);
  digitalWrite(5, HIGH);
  digitalWrite(2, LOW);
  digitalWrite(3, LOW);
  digitalWrite(4, LOW);
  delay(500);
  digitalWrite(5, LOW);
  digitalWrite(2, LOW);
  digitalWrite(3, LOW);
  digitalWrite(4, LOW);
  delay(500);
  goto label;

What is this goto monkeyshine about? Also why do you repeatedly set pins to the same value?

If I had a love-o-meter, I'd try to put it to its original purpose.