diff --git a/LeonardoProMicro/temp_higr_dspl_lux/temp_higr_dspl_lux.ino b/LeonardoProMicro/temp_higr_dspl_lux/temp_higr_dspl_lux.ino index 8841333..ad3bde6 100644 --- a/LeonardoProMicro/temp_higr_dspl_lux/temp_higr_dspl_lux.ino +++ b/LeonardoProMicro/temp_higr_dspl_lux/temp_higr_dspl_lux.ino @@ -1,10 +1,11 @@ #include #include -#include -#include +#include +//#include #include #include -dht DHT; +//DHT.DHT11; +#define DHTTYPE DHT11 #define DHT11_PIN 15 //on board: 15 DHT11 #define VoltPin 18 //on board: 16 GRENN/BLUE #define SCREEN_WIDTH 128 @@ -12,6 +13,7 @@ dht DHT; #define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) #define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); +DHT dht(DHT11_PIN, DHTTYPE); //VOLTAGE: float referenceVoltage = 5.0; @@ -37,11 +39,13 @@ void setup() { display.setCursor(0, 0); display.println("TEST:"); display.display(); + dht.begin(); + } void loop() { // Serrintln(); -int chk = DHT.read11(DHT11_PIN); +int chk = dht.read(DHT11_PIN); uint16_t lux = lightMeter.readLightLevel(); adcValue = analogRead(VoltPin); @@ -70,11 +74,11 @@ int chk = DHT.read11(DHT11_PIN); display.setCursor(0, 0); display.println("Temp:"); display.setCursor(30, 0); - display.println(DHT.temperature); + display.println(dht.readTemperature()); display.setCursor(64, 0); display.println("Hum:"); display.setCursor(90, 0); - display.println(DHT.humidity); + display.println(dht.readHumidity()); display.setCursor(0, 32); display.println("Volt:"); display.setCursor(30, 32);