adafruit / adafruit_htu21df_library Goto Github PK
View Code? Open in Web Editor NEWArduino library for the HTU21D-F sensors in the Adafruit shop
Arduino library for the HTU21D-F sensors in the Adafruit shop
Per the data sheet, the status bits (least significant 2 bits of measurement value) should be set to 0 before calculating physical values.
This is mentioned in the third paragraph on page 12 and in the first paragraph of the "conversion of signal outputs" section on page 15.
It appears to me that the measurement value is used as read without clearing the status bits.
Apparently the bits only need to be cleared (not removed from the measurement value) and the conversion formulas take this into account.
Larry
Arduino board: NODEMCU 0.9 esp8266-12 (non E)
Arduino IDE version 1.6.12
Hey Guys,
Your librarys are allways great and I like working with products of yours. However, I bet you know from the title where this is going. I haven't checked, but please take a look over your libraries, one can easily miss this issue, but it's easy to fix ;)
For the sake of completeness:
Please include something of the following style in your code:
#pragma once
or
#ifndef __ADAFRUIT_HTU21DF__
#define __ADAFRUIT_HTU21DF__
// header code goes here
#endif
There is no need to wait if something is available after Wire.requestFrom().
When the Wire.requestFrom() returns, the I2C transmission has completely finished. The Wire.available() returns the number of bytes in the buffer.
The return value of Wire.requestFrom() could be checked if three bytes are received. Both "while (!Wire.available()) {}" can be removed.
Hi ,
while reading the data from the HTU21D-F the for both temperature and humidity the first byte is OK , but the second and third bytes are "0xFF"
To avoid any kind of problem with non- AVR boards, please tag the library's HEAD
in order to include 23176b9
Thanks 😄
Arduino board: NODEMCU 0.9 esp8266-12 (non E)
Arduino IDE version 1.6.12
this library is not the one that is loaded by 'add libraries' in the ide - it loads an older one or the versioning is wrong.
The new version of the library (1.0.1) does not work with my Si7021 . Whereas 1.0.0 works without problems.
Problem in method ::begin
`
boolean Adafruit_HTU21DF::begin(void) {
Wire.begin();
reset();
Wire.beginTransmission(HTU21DF_I2CADDR);
Wire.write(HTU21DF_READREG);
/* Wire.endTransmission();
Wire.requestFrom(HTU21DF_I2CADDR, 1);
Serial.println(Wire.read(), HEX);
return (Wire.read() == 0x2); // after reset should be 0x2
*/
return (Wire.endTransmission() == 0);
}
return (Wire.read() == 0x2); // after reset should be 0x2 instead of 0x2 returned
0x3A
I slightly corrected the code as shown above - so everything is OK!
The example looks OK after implementing issue #3 but in my first test it crashes after a few readings.
I need to hard reset to get it working again.
I'm using the nightly build version 1.6.4-835-g77d77e8 from github.com/esp8266/arduino with the Arduino board installer
r��HTU21D-F test
Temp: 24.97 Hum: 56.76
Temp: 41.01 Hum: 56.73
Temp: 24.97 Hum: 56.75
Temp: 24.98 Hum: 56.69
Temp: 24.97 Hum: 56.63
Temp: 24.97 Hum: 56.60
Temp: 24.95 Hum: 56.54
Temp: 24.98 Hum: 57.45
Temp: 25.00 Hum: 57.35
Temp: 24.98 Hum: 57.18
Temp: 24.98 Hum: 57.08
Temp: 24.99 Hum: 56.94
Temp: 24.98 Hum: 56.88
Temp:
ctx: cont
sp: 3ffe9b60 end: 3ffe9d40 offset: 01b0
stack>>>
3ffe9d10: 40201c75 3ffe8bf0 3ffe9d98 40202158
3ffe9d20: 00000000 00000000 3ffe9d64 40201cce
3ffe9d30: 00000000 00000000 3ffe8d20 40100118
<<<stack<<<
ets Jan 8 2013,rst cause:1, boot mode:(1,7)
ets Jan 8 2013,rst cause:4, boot mode:(1,7)
wdt reset
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.