#include <DHT.h>
#include <LiquidCrystal.h>
// Constants
#define DHTpin 2
#define DHTType DHT22
DHT dht(DHTpin, DHTType);
// Initialize the LCD (RS, E, D4, D5, D6, D7)
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
// Start the LCD
lcd.begin(16, 2);
// Start the DHT sensor
dht.begin();
// Print initial message
lcd.setCursor(0, 0);
lcd.print("Temp Monitoring");
delay(2000);
}
void loop() {
// Read temperature as Fahrenheit
float tempF = dht.readTemperature(true);
// Display temperature
lcd.setCursor(0, 0);
lcd.print("Temp: ");
lcd.print(tempF);
lcd.print(" F");
// Check for fever
lcd.setCursor(0, 1);
if (tempF >= 99.6) {
lcd.print("Fever");
} else {
lcd.print("No Fever");
}
// Wait before updating again
delay(2000);
}