knitr::opts_chunk$set(echo = TRUE)

Lifecycle: experimental

Control your Raspberry Pi's DHT11 sensor from R.

Acknowledgments: This package imports the DHT11 Python library.

Installation

r2dht11 is currently only available as a GitHub package.

To install it run the following from an R console:

if (!require("remotes")) {
  install.packages("remotes")
}
remotes::install_github("jcrodriguez1989/r2dht11", dependencies = TRUE)

Prerequisites

DHT11 Connection

Please make sure that your DHT11 is correctly connected to your Raspberry Pi. Take note to which GPIO pin is your DHT11 connected.

Usage

In this example, the DHT11 is connected to the GPIO14 pin:

# Load the library.
library("r2dht11")
# Get a DHT11 sensor instance, which is connected to the GPIO 14 pin.
dht11 <- get_dht11_sensor(14)
# Read the sensor's values.
read_sensor(dht11)


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