so that section of my code has changed. as you mentioned before I would be getting 1 byte of information from the high low, then when combined its a 2 byte signed. so what I ended up doing is first the OR operation, then converted into a signed 16 bit , then did the shifting.
what your saying is I need to do this in one line? I’m not sure if I can do that. I wasn’t able to shift by 8 bits before as matlab defaults to unsigned 8 bit precision. When I shifted by 8 it would just zero out the value. I can’t find any information on casting to signed 16. Ill need to look into that.
if acc_combined >= 32768
acc_combined = acc_combined – 65536;
once again thank you for your help. I’m now going to run the entire script and verify that I’m getting the correct pitch and roll. As that’s ultimately the data I need for my project. Thank you again!!