Giter Site home page Giter Site logo

geliang201201 / esp8266_htu21d Goto Github PK

View Code? Open in Web Editor NEW

This project forked from metalphreak/esp8266_htu21d

0.0 2.0 0.0 10 KB

ESP8266 Driver for Measurement Specialties HTU21D i2c Temperature and Relative Humidity Sensor

C 85.68% C++ 14.32%

esp8266_htu21d's Introduction

ESP8266 HTU21D Driver

Driver Library for the Measurement Specialties HTU21D temperature & humidity sensor.

The HTU21D is an i2c device with a temperature sensing element (capable of 14bit resolution or 0.01 degC) and a relative humidity sensing element (capable of 12bit resolution or 0.04%RH).

Sensirion SHT21 appears to be code compatible, but is currently untested.

Usage

In user_init call:

i2c_init();

To read temperature run HTU21D_temperature(&temperature); where temperature is an existing float variable.

To read humidity run HTU21D_humidity(&humidity); where humidity is an existing float variable.

Both functions return integer 1 on success, or integer 0 on failure.

See Example_user_main.c for typical usage. Actual usage is shown within IdleTask function.

Note: ftos() function is provided to convert a float into a text string for use with os_printf

See i2c.h to set the GPIO pins for i2c. Default is SCK = GPIO0, SDA = GPIO2. (you may need to change this depending on your board configuration)

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.