writeuint32()
Description
Writes a 32-bit unsigned integer to the serial port
Breaks the 32-bit integer into four bytes
Sends the four bytes in the order MATLAB / Octave expects.
Syntax
writeUint32(unsigned long myInt)
Parameters
myInt: a 32-bit unsigned integer, of type unsigned long or uint32_t
Returns
None
Example
// This code writes a uint32 to the serial port for MATLAB to read
#include "ArCOM.h" // Include ArCOM library
ArCOM serialPort(SerialUSB); // Create serial port object
unsigned long myInt = 2000001; // Create a uint32
void setup() {
SerialUSB.begin(115200); // Initialize USB serial port
}
void loop() {
serialPort.writeUint32(myInt); // Send the uint32 to MATLAB
}