フィルターのクリア

Bluetooth Module in Matlab

3 ビュー (過去 30 日間)
Niranjan S Pattanshetti
Niranjan S Pattanshetti 2020 年 8 月 18 日
編集済み: Walter Roberson 2020 年 8 月 18 日
I am working on a Matlab project in which I will capture an image using my webcam and I need to send the captured image to my mobile over Bluetooth. so far I have figured out how to connect to my mobile with Bluetooth but not able to send the captured image.
Can you please help me out.

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 8 月 18 日
https://www.mathworks.com/help/instrument/bluetooth-communication.html
create the object, fopen it, fwrite data.
The controller will be responsible for bundling the data into packets with appropriate headers and error detection or correction. The controllers will handle packet retransmit as needed.
  2 件のコメント
Niranjan S Pattanshetti
Niranjan S Pattanshetti 2020 年 8 月 18 日
cam=webcam(1)
img=snapshot(cam)
clear cam
image(img)
btinfo=instrhwinfo('Bluetooth','niranjan')
b=Bluetooth('niranjan',3)
fopen(b)
z=img(:)'
y=whos("z")
fclose(b)
b.OutputBufferSize = y.bytes
fopen(b)
fwrite(b, z, 'int8')
% output at this point is
% Error using icinterface/fwrite (line 187)
% An error occurred during writing
fclose(b)
Can you please help
Walter Roberson
Walter Roberson 2020 年 8 月 18 日
編集済み: Walter Roberson 2020 年 8 月 18 日
Why are you fclose/fopen? You can determine the size of your variable and configure the buffer before you fopen the first time.
It is unlikely that your image from the webcam is int8.

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by