Skip to content

Commit 6388a51

Browse files
authored
Merge pull request #37 from arduino-libraries/karlsoderby/update-temp-humi-library
Update DHT library dependency
2 parents a56d582 + 15469e3 commit 6388a51

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

.github/workflows/compile-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
libraries: |
5555
# Install the library from the local path.
5656
- source-path: ./
57-
- name: DHT sensor library
57+
- name: Grove Temperature And Humidity Sensor
5858
- name: Grove-3-Axis-Digital-Accelerometer-2g-to-16g-LIS3DHTR
5959
- name: Grove - Barometer Sensor BMP280
6060
- name: U8g2

examples/Temp_and_Humidity/Temp_and_Humidity.ino

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
//#define DHTPIN 3 // By default its connected to pin D3, it can be changed, define it before the #include of the library
22
#include "Arduino_SensorKit.h"
33

4+
//uncomment line below if using DHT20
5+
//#define Environment Environment_I2C
6+
47
void setup() {
8+
//uncomment line below if using DHT20
9+
//Wire.begin();
510
Serial.begin(9600);
611
Environment.begin();
712
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ category=Sensors
88
url=https://sensorkit.arduino.cc/
99
architectures=avr
1010
precompiled=false
11-
depends=DHT sensor library,Grove - Barometer Sensor BMP280,U8g2,Grove-3-Axis-Digital-Accelerometer-2g-to-16g-LIS3DHTR
11+
depends=Grove Temperature And Humidity Sensor,Grove - Barometer Sensor BMP280,U8g2,Grove-3-Axis-Digital-Accelerometer-2g-to-16g-LIS3DHTR

src/Arduino_SensorKit.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
//Declare component's classes
44
U8X8_SSD1306_128X64_NONAME_SW_I2C Oled(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE);
5-
DHT Environment(DHTPIN, DHTTYPE);
5+
DHT Environment(DHTPIN,DHT11);
6+
DHT Environment_I2C(DHT20);
67
SensorKit_LIS3DHTR Accelerometer;
7-
SensorKit_BMP280 Pressure;
8+
SensorKit_BMP280 Pressure;

src/Arduino_SensorKit.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
#include "DHT.h" // Temp & Humidity
1717
#include "U8x8lib.h" // OLED Display
1818

19-
//Defines
20-
#ifndef DHTTYPE
21-
#define DHTTYPE DHT11
22-
#endif
2319
#ifndef DHTPIN
2420
#define DHTPIN 3
2521
#endif
@@ -29,4 +25,5 @@ extern U8X8_SSD1306_128X64_NONAME_SW_I2C Oled;
2925
extern SensorKit_LIS3DHTR Accelerometer;
3026
extern SensorKit_BMP280 Pressure;
3127
extern DHT Environment;
32-
#endif
28+
extern DHT Environment_I2C;
29+
#endif

0 commit comments

Comments
 (0)