1.1.1 DHTstable

This commit is contained in:
rob tillaart 2021-12-16 22:03:02 +01:00
parent 58a602221e
commit 0c0e711fc0
11 changed files with 49 additions and 56 deletions

View File

@ -1,13 +1,14 @@
//
// FILE: DHTStable.cpp
// AUTHOR: Rob Tillaart
// VERSION: 1.1.0
// VERSION: 1.1.1
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
// URL: https://github.com/RobTillaart/DHTstable
//
// HISTORY:
// 1.1.0 2021-11-06 fix DHTNew-#67 negative temperature
// 1.1.1 2021-12-16 update library.json, license, minor edits
// 1.1.0 2021-11-06 fix DHTNew-#67 negative temperature
// 1.0.1 2021-06-01 change architecture to fix incompatible flag.
// 1.0.0 2021-05-26 rename files and class to DHTStable to fix incompatible flag.
// changed temperature and humidity to private
@ -15,7 +16,7 @@
// 0.2.9 2021-02-27 fix URL in library.json
// 0.2.8 2021-02-01 fix negative temperature (from DHTStablenew)
// 0.2.7 2020-12-20 add arduino-CI, unit test,
// 0.2.7 2020-12-20 add Arduino-CI, unit test,
// reset(), getTemperature(), getHumidity()
// 0.2.6 2020-07-20 update URL in .cpp
// 0.2.5 2020-06-30 move to own repository; update headers mainly.
@ -30,7 +31,7 @@
// 0.1.11 renamed DHTLIB_TIMEOUT
// 0.1.10 optimized faster WAKEUP + TIMEOUT
// 0.1.09 optimize size: timeout check + use of mask
// 0.1.08 added formula for timeout based upon clockspeed
// 0.1.08 added formula for timeout based upon clock speed
// 0.1.07 added support for DHT21
// 0.1.06 minimize footprint (2012-12-27)
// 0.1.05 fixed negative temperature bug (thanks to Roseman)

View File

@ -2,18 +2,15 @@
//
// FILE: DHTStable.h
// AUTHOR: Rob Tillaart
// VERSION: 1.1.0
// VERSION: 1.1.1
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
// URL: https://github.com/RobTillaart/DHTstable
//
// HISTORY:
// see dht.cpp file
//
#include "Arduino.h"
#define DHTSTABLE_LIB_VERSION (F("1.1.0 - DHTStable"))
#define DHTSTABLE_LIB_VERSION (F("1.1.1 - DHTStable"))
const int DHTLIB_OK = 0;
@ -61,8 +58,8 @@ public:
float getHumidity() { return _humidity; };
float getTemperature() { return _temperature; };
bool getDisableIRQ() { return _disableIRQ; };
void setDisableIRQ(bool b ) { _disableIRQ = b; };
bool getDisableIRQ() { return _disableIRQ; };
void setDisableIRQ(bool b ) { _disableIRQ = b; };
private:
uint8_t _bits[5]; // buffer to receive data

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2014-2021 Rob Tillaart
Copyright (c) 2014-2022 Rob Tillaart
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,22 +1,16 @@
//
// FILE: dht11_test.ino
// AUTHOR: Rob Tillaart
// VERSION: 1.0.0
// PURPOSE: DHT library test sketch for DHT11 && Arduino
// URL: https://github.com/RobTillaart/DHTstable
//
// HISTORY:
// 1.0.0 2021-05-26 class name changed to DHTStable (breaking change)
//
// 0.2.0 use getHumidity() and getTemperature()
// 0.1.2 add URL in header
#include "DHTStable.h"
DHTStable DHT;
#define DHT11_PIN 5
#define DHT11_PIN 5
void setup()
@ -58,4 +52,5 @@ void loop()
delay(2000);
}
// -- END OF FILE --

View File

@ -1,22 +1,16 @@
//
// FILE: dht12_test.ino
// AUTHOR: Rob Tillaart
// VERSION: 1.0.0
// PURPOSE: DHT library test sketch for DHT12 && Arduino
// URL: https://github.com/RobTillaart/DHTstable
//
// HISTORY:
// 1.0.0 2021-05-26 class name changed to DHTStable (breaking change)
//
// 0.2.0 use getHumidity() and getTemperature()
// 0.1.1 add URL in header
#include "DHTStable.h"
DHTStable DHT;
#define DHT12_PIN 5
#define DHT12_PIN 5
void setup()
@ -57,4 +51,6 @@ void loop()
delay(2000);
}
// END OF FILE
// -- END OF FILE --

View File

@ -1,27 +1,15 @@
//
// FILE: dht22_test.ino
// AUTHOR: Rob Tillaart
// VERSION: 1.0.0
// PURPOSE: DHT library test sketch for DHT22 && Arduino
// URL: https://github.com/RobTillaart/DHTstable
//
// HISTORY:
// 1.0.0 2021-05-26 class name changed to DHTStable (breaking change)
//
// 0.2.0 use getHumidity() and getTemperature()
// 0.1.4 add URL in header
// 0.1.03 extended stats for all errors
// 0.1.02 added counters for error-regression testing.
// 0.1.01 ?
// 0.1.00 initial version
//
#include "DHTStable.h"
DHTStable DHT;
#define DHT22_PIN 5
#define DHT22_PIN 5
struct
@ -36,6 +24,7 @@ struct
uint32_t unknown;
} counter = { 0,0,0,0,0,0,0,0};
void setup()
{
Serial.begin(115200);
@ -46,6 +35,7 @@ void setup()
Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)\tTime (us)");
}
void loop()
{
// READ DATA
@ -108,4 +98,6 @@ void loop()
delay(2000);
}
// -- END OF FILE --

View File

@ -1,6 +1,6 @@
# Syntax Coloring Map For DHTStable
# Syntax Colouring Map For DHTStable
# Datatypes (KEYWORD1)
# Data types (KEYWORD1)
DHTStable KEYWORD1
@ -13,16 +13,15 @@ read21 KEYWORD2
read22 KEYWORD2
read33 KEYWORD2
read44 KEYWORD2
read2301 KEYWORD2
read2302 KEYWORD2
read2320 KEYWORD2
read2322 KEYWORD2
getHumidity KEYWORD2
getTemperature KEYWORD2
### obsolete in future
humidity KEYWORD2
temperature KEYWORD2
# Instances (KEYWORD2)
@ -30,3 +29,8 @@ temperature KEYWORD2
# Constants (LITERAL1)
DHTSTABLE_LIB_VERSION LITERAL1
DHTLIB_OK LITERAL1
DHTLIB_ERROR_CHECKSUM LITERAL1
DHTLIB_ERROR_TIMEOUT LITERAL1
DHTLIB_INVALID_VALUE LITERAL1

View File

@ -15,8 +15,9 @@
"type": "git",
"url": "https://github.com/RobTillaart/DHTstable.git"
},
"version": "1.1.0",
"version": "1.1.1",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*"
"platforms": "*",
"headers": "DHTStable.h"
}

View File

@ -1,5 +1,5 @@
name=DHTStable
version=1.1.0
version=1.1.1
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Stable version of library for DHT Temperature & Humidity Sensor

View File

@ -17,9 +17,9 @@ The DHTStable library is a "frozen" version of the DHTlib.
This version is stable for both ARM and AVR.
0.2.5 is a migration to its own repository.
0.2.6 fixed URL to new repro
0.2.6 fixed URL to new repository
0.2.7 getTemperature() and getHumidity() added
added arduino-ci + unit test.
added Arduino-CI + unit test.
0.2.8 fix negative temperature
0.2.9 fix URL in JSON file
@ -44,5 +44,12 @@ See examples.
## Future
- follow bug fixes from DHTnew?
-
- no active development
- follow bug fixes from DHTnew
- on request.
- move some const int to .cpp file
- improve unit test
- add constants test
- add release_notes

View File

@ -27,6 +27,7 @@
unittest_setup()
{
fprintf(stderr, "DHTSTABLE_LIB_VERSION %s\n", (char *) DHTSTABLE_LIB_VERSION);
}
unittest_teardown()
@ -38,7 +39,6 @@ unittest(test_constructor)
{
DHTStable dht;
fprintf(stderr, "%s\n", DHTSTABLE_LIB_VERSION);
assertFalse(dht.getDisableIRQ());
dht.setDisableIRQ(true);