niesteszeck / iddhtlib Goto Github PK
View Code? Open in Web Editor NEWDHT11 & DHT22 interrupt driven library for arduino
License: GNU Lesser General Public License v3.0
DHT11 & DHT22 interrupt driven library for arduino
License: GNU Lesser General Public License v3.0
Hi!
I need a source or reference where you have the formula of double idDHTLib::getDewPointSlow()
from. According to the link in the comments the only function I consider to be relevant is FUNCTION DWPT(T,RH)
but it looks way different to your approach. And the website of NOAA is like an information grave.I would be happy for any hint!
Hello.
I just wanted to tell you that when I include the library in a sketch by navigating the IDE menu through Sketch>Include Library>idDHTLib, this is what gets written into the sketch:
#include <idDHTLib.h>
#include <idDHTLib_cb.h>
#include <max_interrupt.h>
which causes many many errors during compiling, I don't know how Arduino decides which .h files should be included with a library but the files #include idDHTLib_cb.h & max_interrupt.h should obviously not be included in the sketch. For completeness I'll include the error message generated when these files are included, this is the complete error message(sorry about the poor formatting, I have no clue about how I could post this in a nice way, if anyone knows please feel free to inform me), this is the end of this post, the rest is the error message:
Arduino: 1.8.9 (Windows 10), Board: "Arduino Nano, ATmega328P"
C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users...\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users...\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users...\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10809 -build-path C:\Users...\AppData\Local\Temp\arduino_build_382971 -warnings=all -build-cache C:\Users...\AppData\Local\Temp\arduino_cache_546041 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users...\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users...\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users...\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10809 -build-path C:\Users...\AppData\Local\Temp\arduino_build_382971 -warnings=all -build-cache C:\Users...\AppData\Local\Temp\arduino_cache_546041 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino
Using board 'nano' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "C:\Users\...\AppData\Local\Temp\arduino_build_382971\sketch\NANO_DHT11_nonblocking_example.ino.cpp" -o nul
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\...\Documents\Arduino\libraries\idDHTLib-master-v1" "C:\Users\...\AppData\Local\Temp\arduino_build_382971\sketch\NANO_DHT11_nonblocking_example.ino.cpp" -o nul
Using cached library dependencies for file: C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1\idDHTLib.cpp
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\...\Documents\Arduino\libraries\idDHTLib-master-v1" "C:\Users\...\AppData\Local\Temp\arduino_build_382971\sketch\NANO_DHT11_nonblocking_example.ino.cpp" -o "C:\Users\...\AppData\Local\Temp\arduino_build_382971\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\...\AppData\Local\Temp\arduino_build_382971\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\...\Documents\Arduino\libraries\idDHTLib-master-v1" "C:\Users\...\AppData\Local\Temp\arduino_build_382971\sketch\NANO_DHT11_nonblocking_example.ino.cpp" -o "C:\Users\...\AppData\Local\Temp\arduino_build_382971\sketch\NANO_DHT11_nonblocking_example.ino.cpp.o"
In file included from C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:2:0,from C:\Users\...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib.h:100, from C:\Users\...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:1:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:9:0: warning: "MAX_INTERRUPT" redefined
#define MAX_INTERRUPT digitalPinToInterrupt(2)
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:2:0: note: this is the location of the previous definition
#define MAX_INTERRUPT -1
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:13:0: warning: "MAX_INTERRUPT" redefined
#define MAX_INTERRUPT digitalPinToInterrupt(3)
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:9:0: note: this is the location of the previous definition
#define MAX_INTERRUPT digitalPinToInterrupt(2)
^
In file included from C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib.h:100:0,
from C:\Users\...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:1:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:9:0: warning: "PFUNC_CALLBACKS" redefined
#define PFUNC_CALLBACKS &idDHTLib::dhtCallback0
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:4:0: note: this is the location of the previous definition
#define PFUNC_CALLBACKS
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:14:0: warning: "PFUNC_CALLBACKS" redefined
#define PFUNC_CALLBACKS &idDHTLib::dhtCallback0, &idDHTLib::dhtCallback1
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:9:0: note: this is the location of the previous definition
#define PFUNC_CALLBACKS &idDHTLib::dhtCallback0
^
In file included from C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:2:0,
from C:\Users\...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:2:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:2:0: warning: "MAX_INTERRUPT" redefined
#define MAX_INTERRUPT -1
^
In file included from C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:2:0,
from C:\Users\...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib.h:100, from C:\Users\...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:1:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:13:0: note: this is the location of the previous definition
#define MAX_INTERRUPT digitalPinToInterrupt(3)
^
In file included from C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:2:0,
from C:\Users\...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:2:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:9:0: warning: "MAX_INTERRUPT" redefined
#define MAX_INTERRUPT digitalPinToInterrupt(2)
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:2:0: note: this is the location of the previous definition
#define MAX_INTERRUPT -1
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:13:0: warning: "MAX_INTERRUPT" redefined
#define MAX_INTERRUPT digitalPinToInterrupt(3)
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:9:0: note: this is the location of the previous definition
#define MAX_INTERRUPT digitalPinToInterrupt(2)
^
In file included from C:\Users...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:2:0:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:4:0: warning: "PFUNC_CALLBACKS" redefined
#define PFUNC_CALLBACKS
^
In file included from C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib.h:100:0,
from C:\Users\...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:1:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:14:0: note: this is the location of the previous definition
#define PFUNC_CALLBACKS &idDHTLib::dhtCallback0, &idDHTLib::dhtCallback1
^
In file included from C:\Users...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:2:0:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:9:0: warning: "PFUNC_CALLBACKS" redefined
#define PFUNC_CALLBACKS &idDHTLib::dhtCallback0
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:4:0: note: this is the location of the previous definition
#define PFUNC_CALLBACKS
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:14:0: warning: "PFUNC_CALLBACKS" redefined
#define PFUNC_CALLBACKS &idDHTLib::dhtCallback0, &idDHTLib::dhtCallback1
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:9:0: note: this is the location of the previous definition
#define PFUNC_CALLBACKS &idDHTLib::dhtCallback0
^
In file included from C:\Users...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:3:0:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:2:0: warning: "MAX_INTERRUPT" redefined
#define MAX_INTERRUPT -1
^
In file included from C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:2:0,
from C:\Users\...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:2:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:13:0: note: this is the location of the previous definition
#define MAX_INTERRUPT digitalPinToInterrupt(3)
^
In file included from C:\Users...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:3:0:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:9:0: warning: "MAX_INTERRUPT" redefined
#define MAX_INTERRUPT digitalPinToInterrupt(2)
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:2:0: note: this is the location of the previous definition
#define MAX_INTERRUPT -1
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:13:0: warning: "MAX_INTERRUPT" redefined
#define MAX_INTERRUPT digitalPinToInterrupt(3)
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/max_interrupt.h:9:0: note: this is the location of the previous definition
#define MAX_INTERRUPT digitalPinToInterrupt(2)
^
In file included from C:\Users...\Documents\Arduino\NANO_DHT11_nonblocking_example\NANO_DHT11_nonblocking_example.ino:2:0:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h: In function 'void dhtCallback0()':
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:6:59: error: 'objectAtInt' was not declared in this scope
#define CREATE_CALLBACK(x) static void dhtCallback##x() { objectAtInt[x]->dhtCallback(); }
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:10:3: note: in expansion of macro 'CREATE_CALLBACK'
CREATE_CALLBACK(0);
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h: In function 'void dhtCallback1()':
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:6:59: error: 'objectAtInt' was not declared in this scope
#define CREATE_CALLBACK(x) static void dhtCallback##x() { objectAtInt[x]->dhtCallback(); }
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:15:3: note: in expansion of macro 'CREATE_CALLBACK'
CREATE_CALLBACK(1);
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h: At global scope:
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:6:40: warning: 'void dhtCallback0()' defined but not used [-Wunused-function]
#define CREATE_CALLBACK(x) static void dhtCallback##x() { objectAtInt[x]->dhtCallback(); }
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:10:3: note: in expansion of macro 'CREATE_CALLBACK'
CREATE_CALLBACK(0);
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:6:40: warning: 'void dhtCallback1()' defined but not used [-Wunused-function]
#define CREATE_CALLBACK(x) static void dhtCallback##x() { objectAtInt[x]->dhtCallback(); }
^
C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1/idDHTLib_cb.h:15:3: note: in expansion of macro 'CREATE_CALLBACK'
CREATE_CALLBACK(1);
^
Using library idDHTLib-master-v1 in folder: C:\Users...\Documents\Arduino\libraries\idDHTLib-master-v1 (legacy)
exit status 1
Error compiling for board Arduino Nano.
Arduino due has no sei(), cli(). plz change it to
noInterrupts(); delta = micros() - us; interrupts();
The code in the acquiring function ignores two of the 5 bytes returned by a DHT11 on the assumption neither temperature nor humidity results will have a decimal component. This is not correct for the DHT11 part I have (for Temperature anyway) and also contradicts the spec to be found here http://www.micropik.com/PDF/dht11.pdf. Maybe later models are better implementing the spec? Either way ignoring the decimal component in the Temp field creates an incorrect checksum error.
Not an error, but the sum field in the acquiring function is declared as an unsigned 8 bit field so the instruction to mask it using & 0xFF has no effect. Effectively this is just wasting processing cycles.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.