Description Usage Arguments Value Methods (by class) Examples
Reads the temperature of a given sensor instance.
1 2 3 4 | get_temperature(x, ...)
## S4 method for signature 'DHT11'
get_temperature(x, scale = "celsius", max_retries = 10, ...)
|
x |
A sensor instance. |
... |
further arguments passed to or from other methods. |
scale |
One of '"celsius"', '"fahrenheit"' or '"kelvin"', indicating the desired return scale. |
max_retries |
A numeric of length one indicating how many times it should retry in case of issues. |
A numeric of length one with the read temperature in the selected 'scale'. In case of error, it will return 'NA'.
DHT11
:
1 2 3 4 5 6 7 8 | ## Not run:
# Get a DHT11 sensor instance connected at GPIO 14.
sensor <- get_dht11_sensor(14)
# Read the temperature in Celsius and in Fahrenheit.
get_temperature(sensor)
get_temperature(sensor, "fahrenheit")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.