logo
  • 教程列表
  • SO官方文檔
  • 使用串列埠
    • 在 MacLinuxWindows 上建立串列埠
    • 選擇通訊模式
    • 從串列埠讀取
    • 即使丟失或覆蓋也會關閉串列埠
    • 寫入串列埠
    • 自動處理從串列埠接收的資料
  1. StackOverflow 文件
  2. MATLAB Language 教程
  3. 使用串列埠
  4. 從串列埠讀取

從串列埠讀取

Created: November-22, 2018

假設你在這個例子中建立了串列埠物件 s ,那麼

% Read one byte
data = fread(s, 1);

% Read all the bytes, version 1
data = fread(s);

% Read all the bytes, version 2
data = fread(s, s.BytesAvailable);

% Close the serial port
fclose(s);
  • 即使丟失或覆蓋也會關閉串列埠
  • 選擇通訊模式

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明