ar_init: Initiate a connection to the serial port

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

This function sets up a connection to the serial port at the specified port name and baud rate. The port is set in 8-N-1 mode and is opened in fully raw mode so you can send binary data.

Usage

1
ar_init(serialport, baud = 9600L)

Arguments

serialport

Name of the serial port (e.g. "/dev/tty.usbserial","COM1")

baud

Baud rate (bps) in integer.

Value

If connection is setup successfully, this function will return the file descriptor. If not, it will return -1.

Examples

1
2
3
4
5
6
7
8
## Not run: 
# On Windows
con <- ar_init("COM1") 

# On Mac
con <- ar_init("/dev/cu.SLAB_USBtoUART")

## End(Not run)

hebrewseniorlife/arduinor documentation built on May 24, 2019, 8:51 a.m.