ArCOM-Class

Description

Class for a simplified interface to communicate data types with MATLAB / GNU Octave

  • Allows creation of an ArCOM object, to send and receive values

  • Direct calls to Serial and SerialUSB can be used concurrently with ArCOM

Variable declaration

ArCOM serialPort(myInterface);

Definition

  • Creates an ArCOM object called "serialPort", wrapping myInterface.

  • myInterface can be:

    • Serial

    • SerialUSB

    • Serial1

    • Serial2

    • Serial3

    • Serial4

Example

% This code reads an incoming signed 32-bit integer from MATLAB

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

ArCOM mySerialPort(SerialUSB); // Create ArCOM wrapper for SerialUSB

long myValue = 0; // Create a signed 32-bit integer

void setup() {

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

}

void loop() {

myValue = mySerialPort.readInt32(); // Read an incoming Int32

}