Git Product home page Git Product logo

htu21dflib's People

Contributors

bbx10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mayhem marek1914

htu21dflib's Issues

Fix initialization of some sensor revisions

ISSUE: Some sensors failed to init with "htu21df_init:htu21df did not reset" message.

FIX: Change line 124 of htu21dflib.c to
if ((buf[0] & 0xc7) != 0x02) {

Long description:
This issue caused by incorrect checking of user register content during sensor initialization routine.
As stated by manufacturer (see table on page 13 of sensor's datasheet https://cdn-shop.adafruit.com/datasheets/1899_HTU21D.pdf ), values of Reserved bits may be changed by manufacturer ("default
values of respective reserved bits may change over time without prior notice"). And I have real sensors with these bits changed (all '1').
So we need to mask these bits before checking.

PS: Excuse me for text description instead of attaching some diffs or patches. I am absolutely novice on Github.

htu21dflib with raspberry pi A+

Hi!
I hooked up a HTU21D-F Humidity Sensor (adafru.it/1899) to my raspberry pi A+. Was very lucky to find your code. I've installed it and received errors:
opening /dev/i2c-1
htu21df_init:htu21df I2C_RDWR failed -1/5
i2c_init failed -1

Now I'm stuck. Can you give me a hint?
"sudo i2cdetect -y 1" shows there must be something at dress 0x40.
So I think I've wired it right (VIN=Pin1 3.3VDC, GND=Pin9 Ground, SDA=Pin3 SDA1, SCL=Pin5 SLC1).
Stefan

Raspberry Pi Version 1 Support

In the htu21dflib.c file there is a line that is hard coded to the Raspbery V2 i2c value.

static const char I2CDEV[] = "/dev/i2c-1"; // raspberry pi

The version 1 Pi uses the i2c-0 address for the bus. You could maybe add a check for what version it is running on, and set the value accordingly.

Otherwise great code that works well!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.