I am trying to read the readings from the pressure sensor.I have three bytes wihch compromise the reading.Whole number part of the reading compromises of the 18 bits in total(MSB + CSB + 6th and 7th bit of LSB), where as fractinal partof the reading comprises of the 4h and 5th bit of the LSB.
I have made this solution to fetch the final reading using these bytes.
unsigned long m_pressure = I2Cdata;
unsigned long c_pressure = I2Cdata;
unsigned long l_pressure = (I2Cdata>>4)/4;
Here I2Cdata,I2Cdata and I2Cdata are MSB,CSB and LSB respectively.
Is this algorithm is correct ? ?