I need help to export data from hc_06 for plotting my sensor datas

2 次查看(过去 30 天)
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
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:
I hope this helps!
  2 个评论
ALI TURGUT
ALI TURGUT 2024-1-14
Yes I am using readline like this but i need to store 3 datas separately.
Since my device send data continuously I am having problems.
Also i need to make some adjustment on data before plotting, so i need to store them accordingly.
Ayush Modi
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Coexistence Modeling 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by