How to merge 2 data?

2 ビュー (過去 30 日間)
wael elsisi
wael elsisi 2021 年 7 月 18 日
コメント済み: wael elsisi 2021 年 7 月 19 日
How to write the blow code in MATLAB Analysis ?
int16_t send_windSpeed =((msg[0] << 8) + msg[1]) ;

回答 (1 件)

Yongjian Feng
Yongjian Feng 2021 年 7 月 18 日
編集済み: Yongjian Feng 2021 年 7 月 18 日
Are you looking for bitshift function? Something like:
send_windSpeed = bitshift(msg(0), 8) + msg(1);
  3 件のコメント
Yongjian Feng
Yongjian Feng 2021 年 7 月 19 日
What is msg in your original code please?
wael elsisi
wael elsisi 2021 年 7 月 19 日
msg[0] = (send_windSpeed >> 8) & 0xFF; // highest byte
msg[1] = (send_windSpeed ) & 0xFF; // lowest byte
my_mkr.uplink(msg, 2);

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

カテゴリ

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