%% Read Line of ASCII Data from Device
% Create a connection to a serial port device using serialport. You can also connect to a Bluetooth device using bluetooth or a TCP/IP client using tcpclient.

dev = serialport("COM3",9600);

% Set the ASCII terminator and read a string of ASCII data.

configureTerminator(dev,"CR");
data = readline(dev);

% Copyright 2020 The MathWorks, Inc.