Search the Community
Showing results for tags 'logic shift'.
I am reading a 13 bit signed number out of an ADXL345. It is contained in a high byte and a low byte. I joined the two bytes into a UINT16, but for some reason I can't seem to find a way to get this number converted properly into a INT16. I was trying the logical shift but that doesn't take care of it. After I shift the number to the left by 3 bits, is there something else I need to use to shift it back but fill in the sign bit? I searched this forum and the internet, but I couldn't seem to find a definite solution that worked. Thanks for your help.