#include <LiquidCrystal.h>
#include "DHT.h"
#include "RTClib.h"
#include <Adafruit_PM25AQI.h>
#define DHTPIN 2
#define DHTTYPE DHT22
Adafruit_PM25AQI PM;
DHT dht(2, DHT22);
RTC_DS1307 rtc;
LiquidCrystal lcd(12,11,10,9,8,7);
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
void setup() {
lcd.begin(16,2);
dht.begin();
rtc.begin();
}
void loop() {
delay(2000);
lcd.setCursor(0, 0);
DateTime now = rtc.now();
lcd.print(now.month(), DEC);
lcd.print('/');
lcd.print(now.day(), DEC);
lcd.print('/');
lcd.print(now.year(), DEC);
lcd.print("(");
lcd.print(daysOfTheWeek[now.dayOfTheWeek()]);
lcd.print(")");
lcd.setCursor(0, 1);
lcd.print(now.hour(), DEC);
lcd.print(':');
lcd.print(now.minute(), DEC);
lcd.print(':');
lcd.print(now.second(), DEC);
lcd.println();
delay(3000);
lcd.setCursor(0, 0);
lcd.print("Todays AQIIndex:");
lcd.setCursor(0, 1);
lcd.println( );
lcd.println( );
lcd.println( );
lcd.println( );
delay(3000);
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float f = dht.readTemperature(true);
float hif = dht.computeHeatIndex(f, h);
// Compute heat index in Celsius (isFahreheit = false)
float hic = dht.computeHeatIndex(t, h, false);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(F("Humidity:"));
lcd.print(h);
lcd.setCursor(0, 1);
lcd.print(F("Temperature:"));
lcd.print(t);
delay(4000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Have a good day!");
void exit();
}