GY-63_MS5611/libraries/tinySHT2x
2023-12-05 16:14:45 +01:00
..
.github 0.1.2 tinySHT2x + github actions 2023-02-18 13:31:07 +01:00
documents 0.2.0 tinySHT2x 2023-12-05 16:14:45 +01:00
examples 0.2.0 tinySHT2x 2023-12-05 16:14:45 +01:00
test 0.2.0 tinySHT2x 2023-12-05 16:14:45 +01:00
.arduino-ci.yml 0.1.2 tinySHT2x 2022-11-26 14:30:01 +01:00
CHANGELOG.md 0.2.0 tinySHT2x 2023-12-05 16:14:45 +01:00
keywords.txt 0.2.0 tinySHT2x 2023-12-05 16:14:45 +01:00
library.json 0.2.0 tinySHT2x 2023-12-05 16:14:45 +01:00
library.properties 0.2.0 tinySHT2x 2023-12-05 16:14:45 +01:00
LICENSE 0.1.2 tinySHT2x + github actions 2023-02-18 13:31:07 +01:00
README.md 0.2.0 tinySHT2x 2023-12-05 16:14:45 +01:00
tinySHT2x.cpp 0.2.0 tinySHT2x 2023-12-05 16:14:45 +01:00
tinySHT2x.h 0.2.0 tinySHT2x 2023-12-05 16:14:45 +01:00

Arduino CI Arduino-lint JSON check GitHub issues

License: MIT GitHub release PlatformIO Registry

tinySHT2x

Arduino library specific for AVR tiny processors.

Description

The tinySHT2x is an Experimental Arduino library to read the SHT2X sensor. This sensor provides temperature and humidity.

The library is meant for AVR only, tiny platform, so it is minimal (not?) portable.

0.2.0 Breaking change

Version 0.2.0 introduced a breaking change. Wire parameter has moved from begin() to the Constructor. The user has to call Wire.begin() before calling begin().

Interface

#include "tinySHT2x.h"

Functions

  • tinySHT2x(TwoWire * wire = &Wire) Constructor
  • bool begin() initializes internals. Returns true if device can be found.
  • bool isConnected() Returns true if device can be found.
  • bool reset() sends SOFT_RESET command to sensor. returns false if I2C failed to send it.

Async interface

With the Async interface the user must watch keep track of the appropriate delay between the request and read. For temperature this is typical around 70 millis and for humidity 30 millis().

  • void requestTemperature() sends GET_TEMPERATURE command to sensor.
  • void requestHumidity() sends GET_HUMIDITY command to sensor.
  • float readTemperature() fetches data from the sensor.
  • float readHumidity() fetches data from the sensor.

Sync interface

  • float getTemperature(uint8_t del = 70) requests and read the temperature. It uses a delay of 70 milliseconds which can be tuned by the user.

  • float getHumidity(uint8_t del = 30) requests and read the humidity. It uses a delay of30 milliseconds which can be tuned by the user.

  • see https://github.com/RobTillaart/SHT2x

Future

Must

  • test test test test (Viktor)
  • improve documentation

Should

Could

  • investigate async interface
    • splitting requestHumidity() and getHumidity().
    • idem for temperature.
  • Can a tiny have another Wire than Wire?
  • Check the status bit (temperature / humidity flag)
    • datasheet page 8, LSB bit 1 - bit 0 not used)
    • needed?
  • Move Wire parameter to constructor?

Wont

Support

If you appreciate my libraries, you can support the development and maintenance. Improve the quality of the libraries by providing issues and Pull Requests, or donate through PayPal or GitHub sponsors.

Thank you,