bed_connection: Create a connection to IOBED's beds

View source: R/bed_connection.R

bed_connectionR Documentation

Create a connection to IOBED's beds

Description

Setup a connection to the bed serial output with all the specifications needed for the type of its output stream.

Usage

bed_connection(port = "COM3", buffersize = 2^21)

Arguments

port

(chr) the serial port used for the connection.

buffersize

(int, default 2^21, i.e. ~2 MB) number of bytes to dedicate to the buffer.

Value

a connection

Note

The number of bytes used is set to approx 2 MB because the bed stream a line of information of less than 100 characters (about 50-60), collecting sensors signals at 5Hz. So, at 1 Byte each character, it sum up to 0.5 kB/s. 2 MB of buffer should be sufficient to collect 4000 seconds of data (~ 1 hour), that should be both a sufficient and reasonable amount of time for a single session of data collection.

Examples

## Not run: 
  # connect the serial cable to the computer and
  con <- bed_connection() # default port is "COM3"

  port_used <- "COM1"
  bed_connection(port = port_used)

## End(Not run)

UBESP-DCTV/iobed.bed documentation built on Sept. 4, 2022, 5:57 a.m.