#include "DHT.h"
#define DHTPIN A0
#define DHTTYPE DHT22
DHT datosdht(DHTPIN, DHTTYPE);
int contador = 0;
void setup() {
// put your setup code here, to run once:
datosdht.begin();
Serial.begin(9600);
Serial.println("TempC, TempF, Humedad,indiceCalor, registros");
}
void loop() {
// put your main code here, to run repeatedly:
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float humedad = datosdht.readHumidity();
// Read temperature as Celsius (the default)
float tempC = datosdht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float tempF = datosdht.readTemperature(true);
float hic = datosdht.computeHeatIndex(false);
humedad = random(0,100);
tempC = random(0,500)/10.00;
tempF = (tempC *1.8)+32;
Serial.print(tempC);Serial.print(", ");
Serial.print(tempF);Serial.print(", ");
Serial.print(humedad);Serial.print(", ");
Serial.print(hic);Serial.print(", ");
Serial.print(contador);Serial.print(", ");
Serial.println("");
delay(2000);
contador++;
}