OK so my temp sensor has an 10bit resolution, now the temp range will be from -25 to +85, it uses SPI, how do i figure out what lets say 25 degrees will be in binary?
You base type will be an 16 bit signed integer. Shift the result 5 times to the right. Then test bit 9. If this bit 1, you have to or the result with 0xf800. Now you will have the temprature as temprature*4