Robofun 機器人論壇

 找回密碼
 申請會員
搜索
熱搜: 活動 交友 discuz
查看: 2467|回復: 1
打印 上一主題 下一主題

藍芽延遲問題

[複製鏈接]
跳轉到指定樓層
1#
發表於 2014-7-18 04:04:16 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式

大家好


最近在研究兩組運動感測器各接arduino 與藍芽無線(HC-05)並把資料輸出至MATLAB即時繪圖


目前確實兩組感測器都可以收到資料


拔掉藍芽改有線的話兩組可以同時無延遲即時輸出


只接一組感測器的話無線有線都可以無延遲即時輸出


但目前遇到兩組都改成藍芽輸出MATLAB時會有其中一組延遲大概兩秒另外一組則是可以無延遲即時輸出

請求專家幫忙或給點意見  謝謝    試過好多種方法仍然改變不了延遲問題


2#
發表於 2014-7-21 21:04:21 | 只看該作者
回復 1# x10532x

買藍芽無線(HC-06ˊ)從機`比較容易,Hc-05主從一體 你必須注意MATLAB的設定


HC-05 is actually a bluetooth SPP device, so we cannot use traditional serial function in matlab, because its only support "real" COM port.

However, matlab give us a similar lib named "bluetooth" :

http://www.mathworks.com/help/instrument/bluetooth-communication.html

You can apply ccde as below to access the HC-05:

1. first make sure you havn't change the device name of you HC-05, default is "HC-05", you can check it at your bluetooth Properities menu at Control Panel.

2. Code

%creat a bluetooth object%HC-05 channel default is 1b = Bluetooth('HC-05',1);fopen(b);%write and read functionfwrite(b,Bluetooth_Write,'uchar');Bluetooth_Read=fgets(b);%close and clearfclose(b);clear(b);
您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

小黑屋|手機版|Archiver|機器人論壇 from 2005.07

GMT+8, 2024-9-30 15:21 , Processed in 0.164577 second(s), 8 queries , Apc On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表