mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.4.8 DHTNEW
This commit is contained in:
parent
63feead100
commit
3635550954
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// FILE: dhtnew.cpp
|
// FILE: dhtnew.cpp
|
||||||
// AUTHOR: Rob.Tillaart@gmail.com
|
// AUTHOR: Rob.Tillaart@gmail.com
|
||||||
// VERSION: 0.4.7
|
// VERSION: 0.4.8
|
||||||
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
|
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
|
||||||
// URL: https://github.com/RobTillaart/DHTNEW
|
// URL: https://github.com/RobTillaart/DHTNEW
|
||||||
//
|
//
|
||||||
@ -37,10 +37,11 @@
|
|||||||
// 0.4.2 2020-12-15 fix negative temperatures
|
// 0.4.2 2020-12-15 fix negative temperatures
|
||||||
// 0.4.3 2021-01-13 add reset(), add lastRead()
|
// 0.4.3 2021-01-13 add reset(), add lastRead()
|
||||||
// 0.4.4 2021-02-01 fix negative temperatures DHT22 (again)
|
// 0.4.4 2021-02-01 fix negative temperatures DHT22 (again)
|
||||||
// 0.4.5 2021-02-14 fix -0°C encoding of DHT22 ( bit pattern 0x8000 )
|
// 0.4.5 2021-02-14 fix -0°C encoding of DHT22 ( bit pattern 0x8000 )
|
||||||
// 0.4.6 2021-04-09 fix #57 negative temperatures DHT22
|
// 0.4.6 2021-04-09 fix #57 negative temperatures DHT22
|
||||||
// Do not use 0.4.5 and 0.4.4 as these are incorrect for negative temperature.
|
// Do not use 0.4.5 and 0.4.4 as these are incorrect for negative temperature.
|
||||||
// 0.4.7 2021-04-09 fix #60 negative temperatures below -25.5°C + readme.md
|
// 0.4.7 2021-04-09 fix #60 negative temperatures below -25.5°C + readme.md
|
||||||
|
// 0.4.8 2021-05-27 fixes to improve Arduino-lint
|
||||||
|
|
||||||
|
|
||||||
#include "dhtnew.h"
|
#include "dhtnew.h"
|
||||||
@ -236,16 +237,6 @@ int DHTNEW::_read()
|
|||||||
Serial.print(_humidity, 1);
|
Serial.print(_humidity, 1);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TEST OUT OF RANGE
|
|
||||||
if (_humidity > 100)
|
|
||||||
{
|
|
||||||
return DHTLIB_HUMIDITY_OUT_OF_RANGE;
|
|
||||||
}
|
|
||||||
if ((_temperature < -40) || (_temperature > 80))
|
|
||||||
{
|
|
||||||
return DHTLIB_TEMPERATURE_OUT_OF_RANGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
_humidity = constrain(_humidity + _humOffset, 0, 100);
|
_humidity = constrain(_humidity + _humOffset, 0, 100);
|
||||||
_temperature += _tempOffset;
|
_temperature += _tempOffset;
|
||||||
|
|
||||||
@ -255,7 +246,6 @@ int DHTNEW::_read()
|
|||||||
{
|
{
|
||||||
return DHTLIB_ERROR_CHECKSUM;
|
return DHTLIB_ERROR_CHECKSUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DHTLIB_OK;
|
return DHTLIB_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// FILE: dhtnew.h
|
// FILE: dhtnew.h
|
||||||
// AUTHOR: Rob Tillaart
|
// AUTHOR: Rob Tillaart
|
||||||
// VERSION: 0.4.7
|
// VERSION: 0.4.8
|
||||||
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
|
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
|
||||||
// URL: https://github.com/RobTillaart/DHTNEW
|
// URL: https://github.com/RobTillaart/DHTNEW
|
||||||
//
|
//
|
||||||
@ -22,7 +22,7 @@
|
|||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
|
|
||||||
|
|
||||||
#define DHTNEW_LIB_VERSION (F("0.4.7"))
|
#define DHTNEW_LIB_VERSION (F("0.4.8 "))
|
||||||
|
|
||||||
|
|
||||||
#define DHTLIB_OK 0
|
#define DHTLIB_OK 0
|
||||||
@ -34,8 +34,6 @@
|
|||||||
#define DHTLIB_ERROR_TIMEOUT_D -6
|
#define DHTLIB_ERROR_TIMEOUT_D -6
|
||||||
#define DHTLIB_ERROR_TIMEOUT_B -7
|
#define DHTLIB_ERROR_TIMEOUT_B -7
|
||||||
#define DHTLIB_WAITING_FOR_READ -8
|
#define DHTLIB_WAITING_FOR_READ -8
|
||||||
#define DHTLIB_HUMIDITY_OUT_OF_RANGE -100
|
|
||||||
#define DHTLIB_TEMPERATURE_OUT_OF_RANGE -101
|
|
||||||
|
|
||||||
#ifndef DHTLIB_INVALID_VALUE
|
#ifndef DHTLIB_INVALID_VALUE
|
||||||
#define DHTLIB_INVALID_VALUE -999
|
#define DHTLIB_INVALID_VALUE -999
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/RobTillaart/DHTNEW.git"
|
"url": "https://github.com/RobTillaart/DHTNEW.git"
|
||||||
},
|
},
|
||||||
"version":"0.4.7",
|
"version": "0.4.8",
|
||||||
|
"license": "MIT",
|
||||||
"frameworks": "arduino",
|
"frameworks": "arduino",
|
||||||
"platforms": "*"
|
"platforms": "*"
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name=DHTNEW
|
name=DHTNEW
|
||||||
version=0.4.7
|
version=0.4.8
|
||||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||||
sentence=Arduino library for DHT temperature and humidity sensor, with automatic sensortype recognition.
|
sentence=Arduino library for DHT temperature and humidity sensor, with automatic sensortype recognition.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user