Skip to content

Add docs folder #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# ArduinoHTS221 library

## Methods

### `begin()`

Initialize the humidity and temperature sensor.

#### Syntax

```
HTS.begin()
```

#### Parameters

None.

#### Returns

1 on success, 0 on failure.

#### Example

```
if (!HTS.begin()) {
Serial.println("Failed to initialize humidity temperature sensor!");
while (1);
}
```

#### See also

* [end()](#end)
* [readTemperature()](#readTemperature)
* [readHumidity()](#readHumidity)

### `end()`

De-initialize the humidity and temperature sensor.

#### Syntax

```
HTS.end()
```

#### Parameters

None.

#### Returns

None.

#### Example

```
if (!HTS.begin()) {
Serial.println("Failed to initialize humidity temperature sensor!");
while (1);
}

// ...

HTS.end();
```

#### See also

* [begin()](#begin)
* [readTemperature()](#readTemperature)
* [readHumidity()](#readHumidity)

### `readTemperature()`

Read the sensor’s measured temperature value.

#### Syntax

```
HTS.readTemperature()
HTS.readTemperature(units)
```

#### Parameters

* _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.

#### Returns

The temperature in degrees Fahrenheit or Celsius, depending on the units requested.

#### Example

```
float temperature = HTS.readTemperature();

Serial.print("Temperature = ");
Serial.print(temperature);
Serial.println(" °C");
```

#### See also

* [begin()](#begin)
* [end()](#end)
* [readHumidity()](#readHumidity)

### `readHumidity()`

Read the sensor’s measured relative humidity value.

#### Syntax

```
HTS.readHumidity()
```

#### Parameters

None.

#### Returns

The humidity value from the sensor as a percentage.

#### Example

```
float humidity = HTS.readHumidity();

Serial.print("Humidity = ");
Serial.print(humidity);
Serial.println(" %");
```

#### See also

* [begin()](#begin)
* [end()](#end)
* [readTemperature()](#readTemperature)





















17 changes: 17 additions & 0 deletions docs/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ArduinoHTS221 library


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.

To use this library:

```
#include <Arduino_HTS221.h>
```

Main features of the HTS221 sensor:

- Humidity accuracy: ± 3.5% rH, 20 to +80% rH.
- Humidity range: 0 to 100%.
- Temperature accuracy: ± 0.5 °C, 15 to +40 °C.
- Temperature range: -40 to 120° C,