Skip to content

Commit 7118124

Browse files
authored
Merge pull request #9 from canchebagur/add-docs
Add docs folder
2 parents c091030 + 6fb862c commit 7118124

File tree

2 files changed

+180
-0
lines changed

2 files changed

+180
-0
lines changed

docs/api.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# ArduinoHTS221 library
2+
3+
## Methods
4+
5+
### `begin()`
6+
7+
Initialize the humidity and temperature sensor.
8+
9+
#### Syntax
10+
11+
```
12+
HTS.begin()
13+
```
14+
15+
#### Parameters
16+
17+
None.
18+
19+
#### Returns
20+
21+
1 on success, 0 on failure.
22+
23+
#### Example
24+
25+
```
26+
if (!HTS.begin()) {
27+
Serial.println("Failed to initialize humidity temperature sensor!");
28+
while (1);
29+
}
30+
```
31+
32+
#### See also
33+
34+
* [end()](#end)
35+
* [readTemperature()](#readTemperature)
36+
* [readHumidity()](#readHumidity)
37+
38+
### `end()`
39+
40+
De-initialize the humidity and temperature sensor.
41+
42+
#### Syntax
43+
44+
```
45+
HTS.end()
46+
```
47+
48+
#### Parameters
49+
50+
None.
51+
52+
#### Returns
53+
54+
None.
55+
56+
#### Example
57+
58+
```
59+
if (!HTS.begin()) {
60+
Serial.println("Failed to initialize humidity temperature sensor!");
61+
while (1);
62+
}
63+
64+
// ...
65+
66+
HTS.end();
67+
```
68+
69+
#### See also
70+
71+
* [begin()](#begin)
72+
* [readTemperature()](#readTemperature)
73+
* [readHumidity()](#readHumidity)
74+
75+
### `readTemperature()`
76+
77+
Read the sensor’s measured temperature value.
78+
79+
#### Syntax
80+
81+
```
82+
HTS.readTemperature()
83+
HTS.readTemperature(units)
84+
```
85+
86+
#### Parameters
87+
88+
* _units_: FAHRENHEIT to read the temperature in Fahrenheit and CELSIUS to read the temperature in Celsius. If unit parameter is not provided, default is CELSIUS.
89+
90+
#### Returns
91+
92+
The temperature in degrees Fahrenheit or Celsius, depending on the units requested.
93+
94+
#### Example
95+
96+
```
97+
float temperature = HTS.readTemperature();
98+
99+
Serial.print("Temperature = ");
100+
Serial.print(temperature);
101+
Serial.println(" °C");
102+
```
103+
104+
#### See also
105+
106+
* [begin()](#begin)
107+
* [end()](#end)
108+
* [readHumidity()](#readHumidity)
109+
110+
### `readHumidity()`
111+
112+
Read the sensor’s measured relative humidity value.
113+
114+
#### Syntax
115+
116+
```
117+
HTS.readHumidity()
118+
```
119+
120+
#### Parameters
121+
122+
None.
123+
124+
#### Returns
125+
126+
The humidity value from the sensor as a percentage.
127+
128+
#### Example
129+
130+
```
131+
float humidity = HTS.readHumidity();
132+
133+
Serial.print("Humidity = ");
134+
Serial.print(humidity);
135+
Serial.println(" %");
136+
```
137+
138+
#### See also
139+
140+
* [begin()](#begin)
141+
* [end()](#end)
142+
* [readTemperature()](#readTemperature)
143+
144+
145+
146+
147+
148+
149+
150+
151+
152+
153+
154+
155+
156+
157+
158+
159+
160+
161+
162+
163+

docs/readme.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ArduinoHTS221 library
2+
3+
4+
The ArduinoHTS221 library allows you to use the HTS221 sensor available on the Arduino® Nano 33 BLE Sense board to read the temperature and the relative humidity of the environment.
5+
6+
To use this library:
7+
8+
```
9+
#include <Arduino_HTS221.h>
10+
```
11+
12+
Main features of the HTS221 sensor:
13+
14+
- Humidity accuracy: ± 3.5% rH, 20 to +80% rH.
15+
- Humidity range: 0 to 100%.
16+
- Temperature accuracy: ± 0.5 °C, 15 to +40 °C.
17+
- Temperature range: -40 to 120° C,

0 commit comments

Comments
 (0)