Professional Documents
Culture Documents
Temperature Sensor With Buzzer and LED
Temperature Sensor With Buzzer and LED
LED
}
void loop() {
digitalWrite(buzzer,LOW);
// digitalWrite(led,LOW);
temp=analogRead(tempPin);
temp=temp*0.48828125;
if(temp>28)
{beep(50);
beep(50);
digitalWrite(led,HIGH);
}
Serial.print("TEMPERATURE= ");
Serial.print(temp);
Serial.print("Celcius");
Serial.println();
delay(1000);
}
void beep(unsigned char delayms)
{
digitalWrite(buzzer,HIGH);
delay(delayms);
digitalWrite(buzzer,LOW);
delay(delayms);
}