#include <QuadDisplay.h>
#include <DHT.h>
#define DISPLAY_PIN 9
#define DISPLAY_POWER 3
#define DHTPIN 2
DHT dht(DHTPIN, DHT11);
void setup() {
pinMode(DISPLAY_POWER, OUTPUT);
digitalWrite(DISPLAY_POWER, HIGH);
delay(200);
dht.begin();
}
void loop() {
float t = dht.readTemperature();
float h = dht.readHumidity();
if (isnan(t) || isnan(h)) {
displayInt(DISPLAY_PIN, 9999);
delay(500);
return;
}
int temp = (int)t;
int hum = (int)h;
int value = temp * 100 + hum;
displayInt(DISPLAY_PIN, value);
delay(2000);
}