Skip to content

Commit 9b637ca

Browse files
committed
Merge with Wi6Labs Pull Request and add X-NUCLEO examples
1 parent c07bfd5 commit 9b637ca

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
11
# HTS221
22
Arduino library to support the HTS221 capacitive digital sensor for relative humidity and temperature
3+
4+
## API
5+
6+
This sensor uses I2C to communicate. It is then required to create a TwoWire interface before accessing to the sensors:
7+
8+
dev_i2c = new TwoWire(I2C2_SDA, I2C2_SCL);
9+
dev_i2c->begin();
10+
11+
An instance can be created and enbaled following the procedure below:
12+
13+
For the humidity sensor:
14+
15+
HumTemp = new HTS221Sensor (dev_i2c);
16+
HumTemp->Enable();
17+
18+
The access to the sensor values is done as explained below:
19+
20+
Read humidity and temperature.
21+
22+
HumTemp->GetHumidity(&humidity);
23+
HumTemp->GetTemperature(&temperature);
24+
25+
## Documentation
26+
27+
You can find the source files at
28+
https://github.com/stm32duino/HTS221
29+
30+
The HTS221 datasheet is available at
31+
http://www.st.com/content/st_com/en/products/mems-and-sensors/humidity-sensors/hts221.html

0 commit comments

Comments
 (0)