just started and having problems

Hi.
i am try to work on a little project which reads a thermistor for temp displays the value on a lcd and now i would like to have a led to turn on if the value of Temp is = or > than 25 the code works the led in on above 25 but the led flashes on and off below 25 not sure what to do still leaning.

thanks
Chilliman

code below:-

// Project Seven - temperature and lcd
//

int a;
int del=1000; // duration between temperature readings
float temperature;
int B=3975;
float resistance;
// include the library code:
#include <LiquidCrystal.h>
int LED =8;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(2, 3, 4, 5, 6, 7, 8);

void setup()
{
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
//lcd.print(temperature);
pinMode(LED,OUTPUT);
}
void loop()
{
a=analogRead(1);
resistance=(float)(1023-a)*10000/a;
int(temperature=1/(log(resistance/10000)/B+1/298.15)-273.15);
delay(del);
// Turn off the display:
lcd.noDisplay();
delay(100);
// Turn on the display:
lcd.display();
delay(100);
lcd.setCursor(0, 0);

lcd.print("Temp ");
lcd.print(int(temperature));
lcd.print(" C.");
}
{
// turn on led if temp over 25
if (int(temperature)>= 25) digitalWrite(LED,HIGH);
else
digitalWrite(LED,LOW);
}

LiquidCrystal lcd(2, 3, 4, 5, 6, 7, 8);
My Arduino does not have a 8) pin. Strange that yours does.

int LED =8;

You have the LCD and the LED on the same pin? I wonder why that doesn't work.

  resistance=(float)(1023-a)*10000/a;
  int(temperature=1/(log(resistance/10000)/B+1/298.15)-273.15);

You should be doing all floating point arithmetic. 10000 is an int. 10000.0 is a float.

thanks
for the info , noticed that pin 8 was to control the lcd , i changed it to pin 9 it works ok now just need another set of eyes.

thank chilliman

When you are near 25 degree, your led will still flicker due to fluctuations of your readings. If you use this to drive a heater or other things, you could break it by turning it on and off quickly around 25 degree. I suggest you add some hysterisis. Say above 26 then turn on led if its off. Then below 24 turn led off if it is on.