sds011_connect: Connect to the SDS011 air particulate sensor connected via...

Description Usage Arguments Value Examples

View source: R/sds011.R

Description

Connect to the SDS011 air particulate sensor connected via USB

Usage

1
2
3
4
5
6
7
8
sds011_connect(
  port = "ttyUSB0",
  mode = "115200,n,8,1",
  buffering = "none",
  newline = TRUE,
  translation = "auto",
  open = TRUE
)

Arguments

port

Part name. This is usually operating software dependent. For Raspberry Pi with an SDS011 device plugged via USB, this will be ttyUSB0.

mode

A string concatenating the baud rate, parity, databits and stopbits of the communication mode separated by a comma. Default to "115200,n,8,1".

buffering

Connection buffering. Default to "none". Other options is "line" to send buffer after new line character or "full" where write operations are buffed until a connection is flushed.

newline

Logical. Should a transmission end with a newline or not. Default is TRUE or 1.

translation

End of line character to use. Could be "lf", "cr", "crlf", "binary", or "auto". Default to "auto".

open

Logical. Should connection be opened once established? Default to TRUE

Value

A serial interface connection to the SDS011 device via USB

Examples

1
2
3
4
## Not run: 
  sds011_connect()

## End(Not run)

ernestguevarra/rpi documentation built on March 16, 2021, 12:06 a.m.