ArCOM('BytesAvailable')

Description

Returns the number of bytes available to be read from the ArCOM serial port buffer

  • Values returned by Arduino remain in a buffer until they are read with ArCOM('read'...)

Syntax

BytesAvailable = ArCOM('bytesAvailable', Port)

Parameters

Returns

  • BytesAvailable: The number of bytes available to be read.

Example

% 1. This loop spams the command window with a message until 10 bytes are available in the serial port buffer. Then, the bytes are read out and displayed as ASCII characters.

while ArCOM('bytesAvailable', MyPort) < 10

disp('Waiting...');

end

disp(char(ArCOM('read', MyPort, 10, 'uint8')));