I’m reading 16-bit integers from a piece of hardware over the serial port.
Using Python, how can I get the LSB and MSB right, and make Python understand that it is a 16 bit signed integer I’m fiddling with, and not just two bytes of data?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try using the struct module: