const int ds_pin=A2;
const int green_led=6;
const int red_led=7;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(A2, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int sensorValue=analogRead(A2);
float temp = (sensorValue*5.0/1024.0)*100.0;
Serial.print("Temperature: ");
Serial.print(temp);
Serial.println("Celcius");
if(temp>35.0){
digitalWrite(7, HIGH);
digitalWrite(6, LOW);
}
else{
digitalWrite(6, HIGH);
digitalWrite(7, LOW);
}
}