Загрузка данных


#include <QuadDisplay.h>
#include <DHT.h>

#define DISPLAY_PIN 9
#define DHT_PIN 2

DHT dht(DHT_PIN, DHT11);

float temperature = 0;
float humidity = 0;

void setup()
{
  dht.begin();
  displayClear(DISPLAY_PIN);
}

void loop()
{
  temperature = dht.readTemperature();
  humidity = dht.readHumidity();
  
  if (isnan(temperature) || isnan(humidity)) {
    displayDigits(DISPLAY_PIN, QD_E, QD_r, QD_r, QD_NONE);
    delay(2000);
    return;
  }

  int tempInt = int(temperature);
  int humInt = int(humidity);

  displayInt(DISPLAY_PIN, tempInt);
  delay(1000);

  displayInt(DISPLAY_PIN, humInt);
  delay(1000);

}