Skip to content

Commit 05eeb39

Browse files
committed
0.5.2 DHTNEW
1 parent af7e110 commit 05eeb39

File tree

10 files changed

+118
-11
lines changed

10 files changed

+118
-11
lines changed

libraries/DHTNEW/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88

9+
## [0.5.2] - 2024-11-26
10+
- fix #104, add support for KY015 (again)
11+
- minor edits examples
12+
- add **DHT_endless_debug.ino** develop example
13+
14+
915
## [0.5.1] - 2024-11-24
1016
- fix #102, add support for KY015
1117
- add three examples, dhtnew_dht11.ino, dhtnew_dht22.ino, dhtnew_simple.ino

libraries/DHTNEW/dhtnew.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: dhtnew.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.5.1
4+
// VERSION: 0.5.2
55
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
66
// URL: https://github.com/RobTillaart/DHTNEW
77
//
@@ -141,7 +141,7 @@ int DHTNEW::read()
141141
int rv = _read();
142142
if (rv == DHTLIB_OK)
143143
{
144-
// see issue #102
144+
// see issue #102, #104
145145
// test high humidity bits to check for KY015/ DHT11 encoding
146146
// in DHT22 encoding humidity cannot be over 100.0 % == 0x03E8
147147
// so the high bits cannot be over 0x03
@@ -151,9 +151,12 @@ int DHTNEW::read()
151151
{
152152
return rv;
153153
}
154-
// fall through to test KY015 as DHT11
154+
// KY015 as DHT11
155+
_type = 11;
156+
_wakeupDelay = DHTLIB_DHT11_WAKEUP;
157+
rv = _read(); // read again with correct conversion.
158+
return rv;
155159
}
156-
157160
_type = 11;
158161
_wakeupDelay = DHTLIB_DHT11_WAKEUP;
159162
rv = _read();

libraries/DHTNEW/dhtnew.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: dhtnew.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.5.1
5+
// VERSION: 0.5.2
66
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
77
// URL: https://github.com/RobTillaart/DHTNEW
88
//
@@ -18,7 +18,7 @@
1818
#include "Arduino.h"
1919

2020

21-
#define DHTNEW_LIB_VERSION (F("0.5.1"))
21+
#define DHTNEW_LIB_VERSION (F("0.5.2"))
2222

2323

2424
#define DHTLIB_OK 0

libraries/DHTNEW/examples/dhtnew_dht11/dhtnew_dht11.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void setup()
2323
while (!Serial); // MKR1010 needs this
2424

2525
Serial.begin(115200);
26-
Serial.println("dhtnew_test.ino");
26+
Serial.println("dhtnew_dht11.ino");
2727
Serial.print("LIBRARY VERSION: ");
2828
Serial.println(DHTNEW_LIB_VERSION);
2929
Serial.println();

libraries/DHTNEW/examples/dhtnew_dht22/dhtnew_dht22.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void setup()
2323
while (!Serial); // MKR1010 needs this
2424

2525
Serial.begin(115200);
26-
Serial.println("dhtnew_test.ino");
26+
Serial.println("dhtnew_dht22.ino");
2727
Serial.print("LIBRARY VERSION: ");
2828
Serial.println(DHTNEW_LIB_VERSION);
2929
Serial.println();
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
platforms:
2+
rpipico:
3+
board: rp2040:rp2040:rpipico
4+
package: rp2040:rp2040
5+
gcc:
6+
features:
7+
defines:
8+
- ARDUINO_ARCH_RP2040
9+
warnings:
10+
flags:
11+
12+
packages:
13+
rp2040:rp2040:
14+
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
15+
16+
compile:
17+
# Choosing to run compilation tests on 2 different Arduino platforms
18+
platforms:
19+
# - uno
20+
# - due
21+
# - zero
22+
# - leonardo
23+
# - m4
24+
# - esp32
25+
# - esp8266
26+
# - mega2560
27+
# - rpipico
28+
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
//
2+
// FILE: DHT_endless_debug.ino
3+
// AUTHOR: Rob Tillaart
4+
// PURPOSE: demo
5+
// DATE: 2020-06-04
6+
// (c) : MIT
7+
8+
// make _bits public + disable CRC check to run this program.
9+
10+
11+
// DHT PIN layout from left to right
12+
// =================================
13+
// FRONT : DESCRIPTION
14+
// pin 1 : VCC
15+
// pin 2 : DATA
16+
// pin 3 : Not Connected
17+
// pin 4 : GND
18+
19+
20+
#include <dhtnew.h>
21+
22+
DHTNEW dht(5); // ESP 16 UNO 5 MKR1010 5
23+
24+
uint32_t count = 0;
25+
uint32_t start, stop;
26+
27+
uint32_t errors[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
28+
29+
30+
void setup()
31+
{
32+
while (!Serial); // MKR1010 needs this
33+
34+
Serial.begin(115200);
35+
Serial.println("DHT_endless.ino");
36+
Serial.print("LIBRARY VERSION: ");
37+
Serial.println(DHTNEW_LIB_VERSION);
38+
Serial.println();
39+
40+
// MKR1010 needs this
41+
// mySensor.setDisableIRQ(false);
42+
}
43+
44+
45+
void loop()
46+
{
47+
dht.read();
48+
49+
float HumiVal = dht.getHumidity();
50+
float TempVal = dht.getTemperature();
51+
52+
Serial.print(count++);
53+
Serial.print("\t");
54+
for (int i = 0; i < 5; i++)
55+
{
56+
if (dht._bits[i] < 0x10) Serial.print("0");
57+
Serial.print(dht._bits[i], HEX);
58+
Serial.print(" ");
59+
}
60+
Serial.print("\t\t");
61+
Serial.print(TempVal);
62+
Serial.print("\t");
63+
Serial.print(HumiVal);
64+
Serial.println();
65+
66+
delay(2000);
67+
}
68+
69+
70+
// -- END OF FILE --

libraries/DHTNEW/examples/dhtnew_simple/dhtnew_simple.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void setup()
2323
while (!Serial); // MKR1010 needs this
2424

2525
Serial.begin(115200);
26-
Serial.println("dhtnew_test.ino");
26+
Serial.println("dhtnew_simple.ino");
2727
Serial.print("LIBRARY VERSION: ");
2828
Serial.println(DHTNEW_LIB_VERSION);
2929
Serial.println();

libraries/DHTNEW/library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"type": "git",
1414
"url": "https://github.com/RobTillaart/DHTNEW.git"
1515
},
16-
"version": "0.5.1",
16+
"version": "0.5.2",
1717
"license": "MIT",
1818
"frameworks": "*",
1919
"platforms": "*",

libraries/DHTNEW/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=DHTNEW
2-
version=0.5.1
2+
version=0.5.2
33
author=Rob Tillaart <[email protected]>
44
maintainer=Rob Tillaart <[email protected]>
55
sentence=Arduino library for DHT temperature and humidity sensor, with automatic sensortype recognition.

0 commit comments

Comments
 (0)