You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
0 commit comments