readUint32()

Description

Reads a 32-bit unsigned integer from the serial port

  • Blocks execution until 4 bytes are available

  • Reads the bytes, combines them into a uint32 and returns it.

Syntax

myInt = readUint32()

Parameters

None

Returns

  • myInt: an unsigned long or uint32_t read from the serial port.

Example

// This code reads an incoming uint32 from MATLAB

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

ArCOM serialPort(SerialUSB); // Create serial port object

unsigned long myInt = 0; // Create a uint32

void setup() {

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

}

void loop() {

myInt = serialPort.readUint32(); // Read an incoming uint32

}