#define NCT A0
#define ledpin 2
void setup()
{
Serial.begin(9600);
}
void tempC()
{
float SV=25.0;
float tempC = 1/(log(1/(4096./analogRead(NCT)-1))/3950+1.0/298.15)-273.15;
if (tempC>=SV)
{
digitalWrite(ledpin, HIGH);
}
else{
digitalWrite(ledpin, LOW);
}
Serial.print("Temperatuer:");
Serial.print(tempC);
Serial.println("C");
Serial.print("SV=");
Serial.println(SV);
delay(1000);
}
void loop()
{
tempC();
}