I am trying to write a C++ application to send a 64bit word to an Arduino.
I used termios using the method described here
The problem i am having is the byes are arriving at the arduino in least significant byte first.
ie
if a use (where serialword is a uint64_t)
write(fp,(const void*)&serialWord, 8);
the least significant bytes arrive at the arduino first.
this is not the behavior i was wanted, is there a way to get the most significant byes to arrive first? Or is it best to brake the serialword into bytes and send byte by byte?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…