#include <LiquidCrystal_I2C.h> //LIBRERIA
#include "DHT.h" //librería
#define DHTTYPE DHT22 // definir el tipo
const int DHTPin = 15;// indicar el Pin de conexión
DHT dht(DHTPin, DHTTYPE);//dht es el nombre del objeto
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
lcd.init();
lcd.backlight();
Serial.begin(9600);
dht.begin();
}
void loop() {
////////HUMEDAD////////
float h = dht.readHumidity();
////////TEMPERATURA C/////
float t = dht.readTemperature();
////////TEMPERATURA F////
float f = dht.readTemperature(true);
///////INDICE DE CALOR/////
float hit = dht.computeHeatIndex(t,h,false);
lcd.setCursor(0,0);
lcd.print("H% = ");
lcd.setCursor(5,0);
lcd.print(h);
lcd.setCursor(10,0);
lcd.print("T = ");
lcd.setCursor(13,0);
lcd.print(t);
lcd.setCursor(3,1);
lcd.print("IC = ");
lcd.setCursor(8,1);
lcd.print(hit);
}