#include <DHT.h>
#define DHTPIN 5
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
#include <TM1637Display.h>
TM1637Display display = TM1637Display(3,2);
void setup(){
dht.begin();
display.setBrightness(6);
display.clear();
delay(500);
}
void loop(){
byte temperature = dht.readTemperature();
display.showNumberDec(temperature, false, 2, 0);
const uint8_t celsius [] = {
SEG_A | SEG_B | SEG_G | SEG_F,
SEG_A | SEG_D | SEG_E | SEG_F };
display.setSegments ( celsius, 2, 2 ) ;
delay(9000);
byte humidite = dht.readHumidity();
display.showNumberDec(humidite, false, 2, 0);
const uint8_t pourcent [] = {
SEG_A | SEG_B | SEG_G | SEG_F,
SEG_C | SEG_D | SEG_E | SEG_G };
display.setSegments ( pourcent, 2, 2 ) ;
delay(5000);
}