How to read sensor readings from serial port using simulink's serial receive block? I'm trying to plot it but I think there's some issue with datatype

1 次查看(过去 30 天)
Whats the datatype of data received from serial port, I'm trying to receive sensor data via serial port, it reads correctly on arduino IDE serial window but when I read data from simulink's serial receive block, it is very unrealistic. What should be settings for this serial receive block?
  1 个评论
Walter Roberson
Walter Roberson 2017-7-24
How is the data being sent? If you using serial receive block then most likely you have the arduino encoding the values as text, which requires that you receive several characters of text and convert the several characters to a numeric value by interpreting or parsing them. I speculate that instead you are reading individual bytes as if were uint8 and trying to use those as if they were the readings themselves.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Run on Target Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by