get_humidity: Get the humidity of a sensor instance.

Description Usage Arguments Value Methods (by class) Examples

Description

Reads the humidity of a given sensor instance.

Usage

1
2
3
4
get_humidity(x, ...)

## S4 method for signature 'DHT11'
get_humidity(x, max_retries = 10, ...)

Arguments

x

A sensor instance.

...

further arguments passed to or from other methods.

max_retries

A numeric of length one indicating how many times it should retry in case of issues.

Value

A numeric of length one with the read humidity. In case of error, it will return 'NA'.

Methods (by class)

Examples

1
2
3
4
5
6
7
## Not run: 
# Get a DHT11 sensor instance connected at GPIO 14.
sensor <- get_dht11_sensor(14)
# Read the humidity.
get_humidity(sensor)

## End(Not run)

jcrodriguez1989/r2dht11 documentation built on Sept. 6, 2020, 12:07 a.m.