float tempC;
int tempPin = 0; // put your setup code here, to run once:
void setup() {
pinMode(13,OUTPUT);
pinMode(12,OUTPUT);
Serial.begin(9600);
}
void loop()
{
tempC = analogRead(tempPin); //read the value from the sensor
tempC = (5.0 * tempC * 100.0)/1024.0; //convert the analog data to temperature
Serial.print((byte)tempC); //send the data to the computer
Serial.print("\n");
if(tempC >30){
digitalWrite(12,LOW);
digitalWrite(13,HIGH); }
else{
digitalWrite(13,LOW);
digitalWrite(12,HIGH);}
delay(2000);
}