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일

0 개 추천

Are you looking for bitshift function? Something like:
send_windSpeed = bitshift(msg(0), 8) + msg(1);

댓글 수: 3

wael elsisi
wael elsisi 2021년 7월 18일
Thank you fot your reply.
I have got this error when I wrote the code.
Unrecognized function or variable 'msg'.
Error in Get data from a private channel 3 (line 27)
sendSoil_T = bitshift(msg(0), 8) + msg(1);
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);

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2021년 7월 18일

댓글:

2021년 7월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by