writeByte()

Description

Writes a byte to the serial port

  • Equivalent to Serial.write() or SerialUSB.write()

Syntax

writeByte(byte inByte)

Parameters

  • inByte: a byte to write to the serial port

Returns

None

Example

// This code writes a byte to the serial port for MATLAB to read

#include "ArCOM.h" // Include ArCOM library

ArCOM serialPort(SerialUSB); // Create ArCOM object wrapping the USB serial interface

byte myByte = 23; // Create a byte

void setup() {

SerialUSB.begin(115200); // Initialize USB serial port

}

void loop() {

serialPort.writeByte(myByte); // Send the byte to MATLAB

}