question about write to serial

8 ビュー (過去 30 日間)
Weiyue
Weiyue 2024 年 11 月 4 日
回答済み: Supraja 2024 年 11 月 11 日
I want to write this string to the serial, but the signal is wrong. How to wirte this code? Thank you!!!
  4 件のコメント
Weiyue
Weiyue 2024 年 11 月 5 日
編集済み: Weiyue 2024 年 11 月 5 日
Dear Walter Roberson, thank you for your answer. I found the question is that each 8-bits data has a start bit and stop bit as you said. So if there are some ways to remove the start bit and stop bit to make the signal continuous? Thank you very much!
Walter Roberson
Walter Roberson 2024 年 11 月 5 日
When you are measuring the wire signal levels of RS232, then the Start and Stop bits are unavoidable.
Side note: the Start bit is a different length than the Stop bit. I seem to recall that the Stop bit is half of the length of other bits.

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

回答 (1 件)

Supraja
Supraja 2024 年 11 月 11 日
Hi,
It seems like sending deimal values inside the function would help in this case.
Please use the code as below:
write(app.SerialObject, [85, 86, 87, 88], "uint8"); % Decimal equivalents of binary numbers
Refer to 'write' function documentation below for further reference:
I hope this helps!

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by