フィルターのクリア

How do I write bytes to a serial object - to send data over USB-serial XBee to Arduino?

2 ビュー (過去 30 日間)
I am trying to send NMEA messages as data over USB-serial XBee to Arduino to control a robot.
I can open a Serial object and send data from my PC - observing it with another PC and XCTU.
What is the best way to convert the numeric values (uint8) to bytes, and then write them via a Serial objects?

採用された回答

Walter Roberson
Walter Roberson 2016 年 8 月 15 日
uint8 are bytes . You can fwrite() them directly.
  2 件のコメント
William Chamberlain
William Chamberlain 2016 年 8 月 15 日
Doh ; I guess that an 8-bit value could be taken to be a byte.
Thanks.
Walter Roberson
Walter Roberson 2016 年 8 月 15 日
I think that the last time I used a computer whose words were not 8 bits long would have been roughly 1985, the last of my University access to a Honeywell Level/66 . I know some DSPs after used 16 bit bytes and possibly even stranger sizes (especially during the bitsliced era) but I never encountered them myself.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by