I need help to export data from hc_06 for plotting my sensor datas
이전 댓글 표시
I have two sensors they send my bluetooth module 3 datas:
redValues/irValues/acceleration
int32_t/int32_t/float
Those are the data types and names.
I had problems with reading the data on matlab (I'm an unexperienced user).
답변 (1개)
Ayush Modi
2024년 1월 13일
Hi Ali,
I am assuming you are using "bluetooth" function to create bluetooth device object. You can read the data sent to the bluetooth device object using "read" or "readline" function. Here is an example to demonstrate how you can achieve this:
readline(device)
read(device,1,"uint16")
Please refer to the following MathWorks documentation for more information on:
- bluetooth - https://www.mathworks.com/help/matlab/ref/bluetooth.html
- read - https://www.mathworks.com/help/matlab/ref/bluetooth.read.html
- readline - https://www.mathworks.com/help/matlab/ref/bluetooth.readline.html
I hope this helps!
댓글 수: 2
ALI TURGUT
2024년 1월 14일
Ayush Modi
2024년 1월 17일
편집: Ayush Modi
2024년 1월 17일
I am assuming that the data is sent in a fixed format. You can use "NumBytesAvailable" property of the bluetooth object to check the size of the data which is available before reading the data. Once a complete packet is available, you can use "readline" or "read" function.
카테고리
도움말 센터 및 File Exchange에서 Bluetooth Communication에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!