Help with DS18B20 program


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: Help with DS18B20 program

    What happens when you remove the while Oread line? The cocaCola Kid doesn't use that, he just does straight writes to it, and then reads it (in post #17) and it seems to work for him.

    Code:
    ReadDS18B20:
        owout DSDataPin,1,[$CC,$44]     ; Tell sensor to start a temperature conversion
        owout DSDataPin,1,[$CC,$BE]     ; Tell sensor you want to read the temperature
        owin DSDataPin,0,[STR DQ\9]     ; Receive temperature from the sensor
        RawTemp.Byte0 = DQ[0]           ; Extract the temperature portion and put it in its one word variable
        RawTemp.Byte1 = DQ[1]                      
        gosub GetCRC                    ; Calculate the CRC for comparison
        gosub ConvertCelcius            ; Convert temperature to ºC
        gosub ConvertToFahrenheit       ; Convert temperature to ºF
        gosub ConvertToKelvin           ; Convert temperature to K
        return
    http://www.scalerobotics.com

  2. #2
    Join Date
    May 2012
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: Help with DS18B20 program

    Dear ScaleRobotics ..
    When i removed the oread line the graphical lcd put 655.10 all the time and nothing change when i increase or decrease the ds18b20.
    what shall i do to have the temperature variation??!!!!
    Many thanks

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. Replies: 1
    Last Post: - 23rd May 2009, 09:22
  3. Compile and Program help using PICKit2
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th March 2009, 14:51
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30

Members who have read this thread : 2

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