Code for thermostat with 18b20


Results 1 to 12 of 12

Threaded View

  1. #2
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: Code for thermostat with 18b20

    Did you write the code, or is it cut and paste from some other example?

    You need to post more details, hardware config etc. - There are other examples of reading multiple DS18B20's, but the one I use has individual pins for each sensor, rather then individually addressed on the one bus wire, and uses a case statement in the selection process. I also use DT's 18B20 include file which makes working with these sensors a lot simpler

    Code:
    SelectSensor:
      SELECT CASE Channel
        CASE 0 : @ DS1820_Select  _TempSensor1      ; Select the DS18x20 pin
        CASE 1 : @ DS1820_Select  _TempSensor2
        CASE 2 : @ DS1820_Select  _TempSensor3
        CASE 3 : @ DS1820_Select  _TempSensor4
      END SELECT  
    RETURN
    Last edited by Scampy; - 13th May 2015 at 00:48.

Similar Threads

  1. 18B20 and Multi_SPWM issue
    By Scampy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th May 2014, 16:41
  2. Help with 18b20 Stuck with busy bit
    By xapmanis in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th October 2012, 14:52
  3. ds 18b20 circuit.
    By johnyp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th March 2010, 17:40
  4. 18B20 temperature sensor and PIC
    By boban in forum Schematics
    Replies: 2
    Last Post: - 4th June 2007, 13:51
  5. 18B20 Thermometer Question
    By Travin77 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th April 2006, 01:18

Members who have read this thread : 1

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