writeInt16Array()
writeInt16Array()
writeInt16Array()
Description
Writes an array of signed 16-bit integers to the serial port
Syntax
writeInt16Array(short array, unsigned int size)
Parameters
array: a 1xN array of signed 16-bit integers of type short or int16_t.
size: the number of bytes to send from the array (must not exceed array length)
Returns
None
Example
% This writes an int16 array to the serial port for MATLAB to read
#include "ArCOM.h" // Include ArCOM library
ArCOM serialPort; // Create serial port object
short myInts[3] = {333, -444, 555}; // Create an int16 array
void setup() {
SerialUSB.begin(115200); // Initialize USB serial port
}
void loop() {
// Send the int16 array to MATLAB
serialPort.writeInt16Array(myInts, 3);
}