Hi, Not quite sure on how to extract data from LIS2DH12 in 12 bit mode.
It appears to be a 2's complement left justified value.
But making it simple, how do I convert this data... say for a start:
au8_l_Data[0] is the low byte returned from the MEMS (OUT_X_L)
au8_l_Data[1] is the high byte returned from the MEMS (OUT_X_H)
Then in my code:
u16_l_Temp = (uint16_t)au8_l_Data[0];
u16_l_Temp += ((uint16_t)au8_l_Data[1] << 8);
Until here all is ok... but now how do I simply convert this unsigned 16 bit value (u16_l_Temp) into a 16 bit signed value? Simply casting this value to a int16 shouldn't do it if it is a 2's complement... or am I misunderstanding something?
Thanks
Phil
