Please help with code for DS18B20


Results 1 to 40 of 110

Threaded View

  1. #23
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    Thanks for support !!!!
    First code (post #18) return this result : 28 CA C6 48 1 0 0 A7
    Second code (post # 22) return : CA C6 48 01 00 00


    In the code that I write now I use something like this :
    "Init1
    OWOut DQ, 1, [$55, $28, $FE, $DA, $3E, $0, $0, $C1, $4E, $FF, $FF, $7F]
    OWOut DQ, 1, [$55, $28, $CA, $C6, $48, $1, $0, $0, $A7, $48]
    OWOut DQ, 1, [$55, $28, $CA, $C6, $48, $1, $0, $0, $A7, $B8]
    OWOut DQ, 1, [$55, $28, $CA, $C6, $48, $1, $0, $0, $A7, $BE]
    Pause 1000
    OWOut DQ, 0, [Temperature.Byte0, Temperature.Byte1, 0, 0, DS18B20_12bit]


    Init2
    OWOut DQ, 1, [$55, $28, $FE, $DA, $3E, $0, $0, $C1, $4E, $FF, $FF, $7F] 'SENSOR 2 !!!!!!!!! not reading yet !!!!
    OWOut DQ, 1, [$55, $28, $CA, $C6, $48, $1, $0, $0, $A7, $48] 'SENSOR 2 !!!!!!!!! not reading yet !!!!
    OWOut DQ, 1, [$55, $28, $CA, $C6, $48, $1, $0, $0, $A7, $B8] 'SENSOR 2 !!!!!!!!!
    OWOut DQ, 1, [$55, $28, $CA, $C6, $48, $1, $0, $0, $A7, $BE] 'SENSOR 2 !!!!!!!!!
    Pause 1000
    OWOut DQ, 0, [Temperature.Byte0, Temperature.Byte1, 0, 0, DS18B20_12bit]


    Main
    OWOut DQ, 1, [$55, $28, $CA, $C6, $48, $1, $0, $0, $A7, $44] ' Start temperature conversion Sensor 1

    WaitLoop:
    While not DQ
    Wend

    OWOut DQ, 1, [$55, $28, $CA, $C6, $48, $1, $0, $0, $A7, $BE]
    OWIn DQ, 0, [Temperature.Byte0, Temperature.Byte1]
    GoSub Convert_Temp
    GoSub DisplayTemp

    Part2
    OWOut DQ, 1, [$55, $28, $CA, $C6, $48, $1, $0, $0, $A7, $44] ' Start temperature conversion Sensor 2

    WaitLoop2:
    While not DQ
    Wend"



    I hope it's good...will see !
    Last edited by fratello; - 10th January 2009 at 22:40.

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 22:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 22:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 9th December 2008, 00:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 18:23

Members who have read this thread : 3

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