Can anyone verify that this is correct? The msb register is 8 bits and the lsb is the first 6 bits of another register.
int rawData = ((msb << 8) | lsb) >> 2;
This code is oversimplified for clarity btw.
Can anyone verify that this is correct? The msb register is 8 bits and the lsb is the first 6 bits of another register.
int rawData = ((msb << 8) | lsb) >> 2;
This code is oversimplified for clarity btw.
if lsb is 2 bytes trash then 6 bytes good data, you just want to do this:
int rawData = (msb << 6) | lsb;
if it's 6 bytes good data, then 2 bytes trash, your version is fine.
Awesome! Thanks