DS1820 Negative Numbers and OffSet


Results 1 to 6 of 6

Threaded View

  1. #4
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: DS1820 Negative Numbers and OffSet

    Quote Originally Posted by scrwld View Post
    ************************************************** *************
    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

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts