Hi Fredrick,

This might help:
Quote Originally Posted by Darrel Taylor View Post
Give this a try...
Code:
Sign  VAR  BIT
TempC VAR  WORD

; read DS1820 here

Sign = TempC.15
TempC = ABS(TempC)
TempC =(TempC>>1)*10 + (TempC.0 * 5)
IF Sign then LCDOUT "-"
LCDOUT dec (TempC/10),".",dec TempC//10
<br>
Quote Originally Posted by sayzer View Post
It is finally working now for the negative values.

I did not have this TempC = ABS(TempC) before TempC =(TempC>>1)*10 + (TempC.0 * 5)

But, now I get correct values.

Thanks a lot Darrel.
Regards.
http://www.picbasic.co.uk/forum/showthread.php?t=4820

-Adam-