GithubHelp home page GithubHelp logo

mvdw / arduino-sht Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sensirion/arduino-sht

0.0 0.0 0.0 78 KB

Repository for Sensirion humidity and temperature sensor support on Arduino

License: BSD 3-Clause "New" or "Revised" License

C++ 99.59% C 0.41%

arduino-sht's Introduction

arduino-sht

Repository for Sensirion humidity and temperature sensor support on Arduino

Supported sensors:

  • SHTC1
  • SHTC3
  • SHTW1
  • SHTW2
  • SHT3x-DIS (I2C)
  • SHT3x-ARP (ratiometric analog voltage output)
  • SHT85
  • SHT4x

Installation

The recommended way to install arduino-sht is through the Library Manager of the Arduino IDE. To access it, go to the Tools menu and select Manage Libraries..., and search for the library name there.

If you prefer to install it manually, you can download either via git or from the releases page and place it in your Arduino/libraries directory. After restarting the Arduino IDE, you will see the new SHTSensor menu items under libraries and examples.

Integrating it into your sketch

Assuming you installed the library as described above, the following steps are necessary:

  1. Import the Wire library like this: From the menu bar, select Sketch > Import Library > Wire
  2. Import the arduino-sht library: From the menu bar, select Sketch > Import Library > arduino-sht
  3. Create an instance of the SHTSensor class (SHTSensor sht;)
  4. In setup(), make sure to init the Wire library with Wire.begin()
  5. If you want to use the serial console, remember to initialize the Serial library with Serial.begin(9600)
  6. Call sht.readSample() in the loop() function, which reads a temperature and humidity sample from the sensor
  7. Use sht.getHumidity() and sht.getTemperature() to get the values from the last sample

Important: getHumidity() and getTemperature() do not read a new sample from the sensor, but return the values read last. To read a new sample, make sure to call readSample()

Example projects

See example project sht-autodetect

Usage with multiple SHT31 sensors

See example project multiple-sht-sensors

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.