writeuint32array

Description

Writes an array of unsigned 32-bit integers to the serial port

Syntax

writeUint32Array(unsigned long array, unsigned int size)

Parameters

  • array: a 1xN array of 32-bit unsigned integers of type unsigned long or uint32_t.

  • size: the number of integers to send from the array (must not exceed array length)

Returns

None

Example

// This writes a uint32 array to the serial port for MATLAB to read

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

ArCOM serialPort; // Create serial port object

unsigned long myInts[3] = {4, 4000, 400000}; // Create array

void setup() {

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

}

void loop() {

// Send the uint32 array to MATLAB

serialPort.writeUint32Array(myInts, 3);

}