Re: DS1820 Negative Numbers and OffSet

Originally Posted by
scrwld
************************************************** *************
hi(hola) gadelhas,
i read you program try this:
SENSOR:
owout DQ,1,[$CC, $44]
Pause 200
owout DQ,1,[$CC, $BE]
OWIn DQ, 2, [TempC.byte0, TempC.byte1]
sign = tempc.15
TempC = ABS(TempC)
TempC =(TempC>>1)*10 + (TempC.0 * 5)
' if OFFSETTEMP = -3 and temperature = 30 tempc=tempc+(-3)=27
' if OFFSETTEMP = 3 and temperature = 30 tempc=tempc+(3)=33
' put this line in you code look the picture
----> Tempc=Tempc+OFFSETTEMP
return
Hi scrwld ;
it dosen't work like should be.
But still trying.
EDIT:
After trying other things with your line of code, it doesn't work like should be.
However thanks for watching and answering my post.
Last edited by gadelhas; - 23rd April 2011 at 19:51.
Thanks and Regards;
Gadelhas
Bookmarks