I have a function in python which reads the first 3 bytes in a serial port buffer. I then want to convert the third byte to an integer which will allow me to determine the length of the total byte array. However, when I use int()
I get the following error:
ValueError: invalid literal for int() with base 16: b'\x16'
I've tried slicing the string further along, but that just returns b''. How can I convert the byte to an integer?
Thank you!