How to merge 2 data?

3 vues (au cours des 30 derniers jours)
wael elsisi
wael elsisi le 18 Juil 2021
Commenté : wael elsisi le 19 Juil 2021
How to write the blow code in MATLAB Analysis ?
int16_t send_windSpeed =((msg[0] << 8) + msg[1]) ;

Réponses (1)

Yongjian Feng
Yongjian Feng le 18 Juil 2021
Modifié(e) : Yongjian Feng le 18 Juil 2021
Are you looking for bitshift function? Something like:
send_windSpeed = bitshift(msg(0), 8) + msg(1);
  3 commentaires
Yongjian Feng
Yongjian Feng le 19 Juil 2021
What is msg in your original code please?
wael elsisi
wael elsisi le 19 Juil 2021
msg[0] = (send_windSpeed >> 8) & 0xFF; // highest byte
msg[1] = (send_windSpeed ) & 0xFF; // lowest byte
my_mkr.uplink(msg, 2);

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by