#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
DHT dht(DHTPIN, DHTTYPE);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
dht.begin();
}
void loop() {
// put your main code here, to run repeatedly:
float temperatura = dht.readTemperature();
float humitat = dht.readHumidity();
Serial.print(("Humitat: "));
Serial.print(humitat);
Serial.print(("% Temperatura: "));
Serial.print(temperatura);
Serial.println(F("°C "));
}