Skip to content

Commit

Permalink
0.5.2 DHTNEW
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Dec 29, 2024
1 parent af7e110 commit 05eeb39
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 11 deletions.
6 changes: 6 additions & 0 deletions libraries/DHTNEW/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.5.2] - 2024-11-26
- fix #104, add support for KY015 (again)
- minor edits examples
- add **DHT_endless_debug.ino** develop example


## [0.5.1] - 2024-11-24
- fix #102, add support for KY015
- add three examples, dhtnew_dht11.ino, dhtnew_dht22.ino, dhtnew_simple.ino
Expand Down
11 changes: 7 additions & 4 deletions libraries/DHTNEW/dhtnew.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FILE: dhtnew.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.5.1
// VERSION: 0.5.2
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
// URL: https://github.com/RobTillaart/DHTNEW
//
Expand Down Expand Up @@ -141,7 +141,7 @@ int DHTNEW::read()
int rv = _read();
if (rv == DHTLIB_OK)
{
// see issue #102
// see issue #102, #104
// test high humidity bits to check for KY015/ DHT11 encoding
// in DHT22 encoding humidity cannot be over 100.0 % == 0x03E8
// so the high bits cannot be over 0x03
Expand All @@ -151,9 +151,12 @@ int DHTNEW::read()
{
return rv;
}
// fall through to test KY015 as DHT11
// KY015 as DHT11
_type = 11;
_wakeupDelay = DHTLIB_DHT11_WAKEUP;
rv = _read(); // read again with correct conversion.
return rv;
}

_type = 11;
_wakeupDelay = DHTLIB_DHT11_WAKEUP;
rv = _read();
Expand Down
4 changes: 2 additions & 2 deletions libraries/DHTNEW/dhtnew.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// FILE: dhtnew.h
// AUTHOR: Rob Tillaart
// VERSION: 0.5.1
// VERSION: 0.5.2
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
// URL: https://github.com/RobTillaart/DHTNEW
//
Expand All @@ -18,7 +18,7 @@
#include "Arduino.h"


#define DHTNEW_LIB_VERSION (F("0.5.1"))
#define DHTNEW_LIB_VERSION (F("0.5.2"))


#define DHTLIB_OK 0
Expand Down
2 changes: 1 addition & 1 deletion libraries/DHTNEW/examples/dhtnew_dht11/dhtnew_dht11.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void setup()
while (!Serial); // MKR1010 needs this

Serial.begin(115200);
Serial.println("dhtnew_test.ino");
Serial.println("dhtnew_dht11.ino");
Serial.print("LIBRARY VERSION: ");
Serial.println(DHTNEW_LIB_VERSION);
Serial.println();
Expand Down
2 changes: 1 addition & 1 deletion libraries/DHTNEW/examples/dhtnew_dht22/dhtnew_dht22.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void setup()
while (!Serial); // MKR1010 needs this

Serial.begin(115200);
Serial.println("dhtnew_test.ino");
Serial.println("dhtnew_dht22.ino");
Serial.print("LIBRARY VERSION: ");
Serial.println(DHTNEW_LIB_VERSION);
Serial.println();
Expand Down
28 changes: 28 additions & 0 deletions libraries/DHTNEW/examples/dhtnew_endless_debug/.arduino-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
platforms:
rpipico:
board: rp2040:rp2040:rpipico
package: rp2040:rp2040
gcc:
features:
defines:
- ARDUINO_ARCH_RP2040
warnings:
flags:

packages:
rp2040:rp2040:
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

compile:
# Choosing to run compilation tests on 2 different Arduino platforms
platforms:
# - uno
# - due
# - zero
# - leonardo
# - m4
# - esp32
# - esp8266
# - mega2560
# - rpipico

Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
//
// FILE: DHT_endless_debug.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// DATE: 2020-06-04
// (c) : MIT

// make _bits public + disable CRC check to run this program.


// DHT PIN layout from left to right
// =================================
// FRONT : DESCRIPTION
// pin 1 : VCC
// pin 2 : DATA
// pin 3 : Not Connected
// pin 4 : GND


#include <dhtnew.h>

DHTNEW dht(5); // ESP 16 UNO 5 MKR1010 5

uint32_t count = 0;
uint32_t start, stop;

uint32_t errors[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };


void setup()
{
while (!Serial); // MKR1010 needs this

Serial.begin(115200);
Serial.println("DHT_endless.ino");
Serial.print("LIBRARY VERSION: ");
Serial.println(DHTNEW_LIB_VERSION);
Serial.println();

// MKR1010 needs this
// mySensor.setDisableIRQ(false);
}


void loop()
{
dht.read();

float HumiVal = dht.getHumidity();
float TempVal = dht.getTemperature();

Serial.print(count++);
Serial.print("\t");
for (int i = 0; i < 5; i++)
{
if (dht._bits[i] < 0x10) Serial.print("0");
Serial.print(dht._bits[i], HEX);
Serial.print(" ");
}
Serial.print("\t\t");
Serial.print(TempVal);
Serial.print("\t");
Serial.print(HumiVal);
Serial.println();

delay(2000);
}


// -- END OF FILE --
2 changes: 1 addition & 1 deletion libraries/DHTNEW/examples/dhtnew_simple/dhtnew_simple.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void setup()
while (!Serial); // MKR1010 needs this

Serial.begin(115200);
Serial.println("dhtnew_test.ino");
Serial.println("dhtnew_simple.ino");
Serial.print("LIBRARY VERSION: ");
Serial.println(DHTNEW_LIB_VERSION);
Serial.println();
Expand Down
2 changes: 1 addition & 1 deletion libraries/DHTNEW/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/DHTNEW.git"
},
"version": "0.5.1",
"version": "0.5.2",
"license": "MIT",
"frameworks": "*",
"platforms": "*",
Expand Down
2 changes: 1 addition & 1 deletion libraries/DHTNEW/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=DHTNEW
version=0.5.1
version=0.5.2
author=Rob Tillaart <[email protected]>
maintainer=Rob Tillaart <[email protected]>
sentence=Arduino library for DHT temperature and humidity sensor, with automatic sensortype recognition.
Expand Down

0 comments on commit 05eeb39

Please sign in to comment.