MATLAB在Mac / Linux / Windows上创建串行端口
示例
% Define serial port with a baud rate of 115200
rate = 115200;
if ispc
s = serial('COM1', 'BaudRate',rate);
elseif ismac
% Note that on OSX the serial device is uniquely enumerated. You will
% have to look at /dev/tty.* to discover the exact signature of your
% serial device
s = serial('/dev/tty.usbserial-A104VFT7', 'BaudRate',rate);
elseif isunix
s = serial('/dev/ttyusb0', 'BaudRate',rate);
end
% Set the input buffer size to 1,000,000 bytes (default: 512 bytes).
s.InputBufferSize = 1000000;
% Open serial port
fopen(s);
热门推荐
4 天仙配简短祝福语
10 生日祝福语 简短独特潮
11 鼠年同事祝福语简短创意
12 关于水的简短祝福语
13 婚礼伴娘祝福语大全简短
14 校庆祝福语简短横幅
15 男生节搞笑简短祝福语
16 离职送别文案祝福语简短
17 新年祝福语大全简短成语
18 生日贺卡祝福语英文简短