#include <DHT.h>
#include <Wire.h>
#include <LiquidCrystal_12C.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN,DHTTYPE)
const int potPin = A0;
const int fanPin = 3; // Connect the fan to this pin
LiquidCrystal_12C lcd(0x27 , 16, 2); // set the LCD address and dimensions
void setup(){
dht.begin();
pinMode(fanPin, OUTPUT);
lcd.init(); // initialize the LCD
lcd.backlight(); // Trun on the backlight
lcd.setCursor(0, 0);
lcd.print ("Temp Fan Control");
lcd.setCursor(0,1);
lcd.print("by YOur Name");
delay(2000);
lcd.clear();
}
void loop() {
int threshold = map(analogRead(potPin)),0, 1023,20,40);// Map potentiometer value to
temperature range