%% Write Data to 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);

% Write the values [1,2,3,4,5] in uint8 format. These five values at one byte each are a total of five bytes.

write(dev,1:5,"uint8")

% Copyright 2020 The MathWorks, Inc.