float temperature;
int pinA0 = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
// read analog volt from sensor and save to variable temp
int analogValue = analogRead(pinA0);
// convert the analog volt to its temperature equivalent _ BETA=3950
//temperature = 1 / (log(1 / (1023. / analogValue - 1)) / 3950 + 1.0 / 298.15) - 273.15;
//temperature = (125*analogValue) >> 8;
digitalWrite(3, HIGH); // LED de controlo
if(temperature>=30)
digitalWrite(4, HIGH);
else
digitalWrite(4, LOW);
if(temperature>=60)
digitalWrite(5, HIGH);
else
digitalWrite(5, LOW);
//display temperature value
Serial.print("TEMPERATURE = ");
Serial.print(temperature);
Serial.print("*C");
Serial.println();
delay(50);
}