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

寫入串列埠

Created: November-22, 2018

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

% Write one byte
fwrite(s, 255);

% Write one 16-bit signed integer
fwrite(s, 32767, 'int16');

% Write an array of unsigned 8-bit integers
fwrite(s,[48 49 50],'uchar');

% Close the serial port
fclose(s);
  • 自動處理從串列埠接收的資料
  • 即使丟失或覆蓋也會關閉串列埠

Copyright © 2018. All right reserved

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

  • 關於本站
  • 免責聲明