MATLAB Answers

RS232 on Speedgoat

12 ビュー (過去 30 日間)
Rafael Kübler
Rafael Kübler 2019 年 4 月 17 日
回答済み: Diego Kuratli 2019 年 9 月 15 日
Hello,
with a Speedgoat Baseline and Simulink Real-Time I want to get data from a ultrasoundsensor via a RS232 serial Port. The discription of the Sensor says:
"Set the microcontroller's serial port to use 9600 baud at 8-N-1 (eight data bits, no parity, one stop bit).
To start measuring the distance, output a 0x55 over the serial port and read back the two byte distance in high byte, low byte format. The distance returned is
measured in millimeters. Use the following formula to obtain the distance as millimeters:
Millimeters = FirstByteRead * 256 + SecondByteRead"
The data collection should be done once every second.
Now I'm not familliar with serial ports and the examples here on the MathWorks page don't get me further either.
Can anyone hlep me with the Simulink Real-Time model or give me a hint on what to read?
Thank you for your help.

  0 件のコメント

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

回答 (1 件)

Diego Kuratli
Diego Kuratli 2019 年 9 月 15 日

  0 件のコメント

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

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by