Why? Temp conversion C to F code from Rentron (Bruce)


Results 1 to 11 of 11

Threaded View

  1. #3
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default Re: Why? Temp conversion C to F code from Rentron (Bruce)

    Hi Dwight

    I hope you don't mind me taking this for you.

    We start here with an assumption of temperature higher than 0deg
    You may skip this if you put it inside the IF/ELSE as I showed
    Sign = "+"
    Code:
    
    
    ' This one does temperature * 11.25
     Dummy = 1125 * R_Temp 
    TempF = DIV32 100
    
    ' yes, this checks for 67.95+32.00
    ' if the reading goes above this value, 
    '  it must be a negative value(offset binary values), so, the else comes into play
     IF TempF >6795 THEN ' Over 99.5 deg F..?      
         TempF = TempF + 3200
         Sign = "+"
     ELSE      
          TempF = TempF + 3200
         Sign = "-"
     ENDIF  
     RETURN  ' with TempF loaded with current temp in deg F 
             ' and Sign having the sign of the temperature
    

    PS: I noticed Bruce already answered your query before I posted.
    Last edited by Jerson; - 17th May 2011 at 15:53.

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