作者kobegreat ()
看板MATLAB
標題[設定]MATLAB和藍芽做連接
時間Wed Jun 1 02:49:34 2016
各位好
我最近有再用藍芽跟matlab做結合
附上我的程式碼
clc;clear;close all;
SerPIC = serial('COM6'); %<--change this appropriately
set(SerPIC,'BaudRate', 9600, 'DataBits', 8, 'Parity', 'none','StopBits', 1,
'FlowControl', 'none');
fopen(SerPIC); %--open the serial port to the PIC
卻出現以下訊息
Error using serial/fopen (line 72)
Open failed: Port: COM6 is not available. Available ports: COM10.
Use INSTRFIND to determine if other instrument objects are connected to the
requested device.
Error in test1 (line 5)
fopen(SerPIC); %--open the serial port to the PIC
程式碼裡的com改成com10也一樣不行
可是我用rs232一樣的matlab程式碼可以傳值 藍芽接終端機也可以傳值
不知道問題到底出在哪裡
想請問大家有什麼辦法可以解決嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.116.179.121
※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1464720578.A.57F.html
推 gR7P4zXH: 筆電內建藍芽?要不要試用port=Bluetooth(...);fopen(por 06/11 13:15
→ gR7P4zXH: t); 06/11 13:15