Reading Serial Data in Matlab

3 visualizzazioni (ultimi 30 giorni)
Malaidevan
Malaidevan il 24 Dic 2019
Commentato: Malaidevan il 30 Dic 2019
Hi everyone,
I need to get BME280 sensor values in Matlab for further processing. I've got the exact values of Pressure temperature and RH on the Arduino Serial Monitor. But when I attempt the same in Matlab using serialport and read commands I get random values. Is there anything I'm missing? I have attempted nearly all the MATLAB commands related to serial communication but I don't seem to progress anywhere. Can anyone help me out of this problem ?
I have checked the RS232 values using an emulator and crosschecked that the port is giving the required values...
Because of this small issue my whole project is stuck, please help me out of this...
  2 Commenti
Mohammad Sami
Mohammad Sami il 30 Dic 2019
Are you configuring the connection correctly ? (Baud rate, parity data bit, stop bit e.t.c.)
The available configuration options are shown in the documentation for serialport function.
Malaidevan
Malaidevan il 30 Dic 2019
Thanks for Responding Sami...
I got to a solution.. Apparently, the data I have been getting is of ASCII format. When I converted them to double using the command "str2num" I got the data I required...

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Instrument Control Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by