send int16 via std_msg/string msg
Dear All
I am trying to send out int16 from host pc to arduino target. I firstly converted the int16 to two chars and then packaged them into one std_msg/string and send it to the target. My problem is that when I send data which is < 256 and > 0. the high bit will be zero. In this case, the string length will not be two char anymore which cause the com failed. Do anyone know how to fix this problem? thanks a lot.
I understand that my approach is a little awkward. I can use std_msg/int16 do that job directly. I am doing this is aiming to use the same string to carry multiple commands and data.