https://github.com/stm32duino/hts221
Arduino library to support the HTS221 capacitive digital sensor for relative humidity and temperature
https://github.com/stm32duino/hts221
Last synced: 4 months ago
JSON representation
Arduino library to support the HTS221 capacitive digital sensor for relative humidity and temperature
- Host: GitHub
- URL: https://github.com/stm32duino/hts221
- Owner: stm32duino
- Created: 2017-07-21T12:19:44.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2023-11-28T09:39:37.000Z (over 1 year ago)
- Last Synced: 2023-11-28T10:38:57.589Z (over 1 year ago)
- Language: C
- Size: 26.4 KB
- Stars: 5
- Watchers: 6
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTS221
Arduino library to support the HTS221 capacitive digital sensor for relative humidity and temperature## API
This sensor uses I2C to communicate. It is then required to create a TwoWire interface before accessing to the sensors:
TwoWire dev_i2c(I2C_SDA, I2C_SCL);
dev_i2c.begin();An instance can be created and enabled following the procedure below:
For the humidity sensor:
HTS221Sensor HumTemp(&dev_i2c);
HumTemp.begin();
HumTemp.Enable();The access to the sensor values is done as explained below:
Read humidity and temperature.
float humidity;
float temperature;
HumTemp.GetHumidity(&humidity);
HumTemp.GetTemperature(&temperature);## Documentation
You can find the source files at
https://github.com/stm32duino/HTS221The HTS221 datasheet is available at
http://www.st.com/content/st_com/en/products/mems-and-sensors/humidity-sensors/hts221.html