Go Down

Topic: BMA180 MSB and LSB (Read 662 times) previous topic - next topic


Can anyone verify that this is correct? The msb register is 8 bits and the lsb is the first 6 bits of another register.
Code: [Select]

int rawData = ((msb << 8) | lsb) >> 2;

This code is oversimplified for clarity btw.
fuzzball27 >>-->


if lsb is 2 bytes trash then 6 bytes good data, you just want to do this:
Code: [Select]

int rawData = (msb << 6) | lsb;

if it's 6 bytes good data, then 2 bytes trash, your version is fine.


fuzzball27 >>-->

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131