picaxe readtemp function equivalent in picbasic


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: picaxe readtemp function equivalent in picbasic

    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Oct 2011
    Location
    Western Australia
    Posts
    3


    Did you find this post helpful? Yes | No

    Default Re: picaxe readtemp function equivalent in picbasic

    Sorry I'm still not really grasping the concept;
    my current code looks simular to this

    in picaxe
    readtemp 0, b0 'storage cell 1 temp
    readtemp 1, b1 'storage cell 2 temp

    start:
    let b0=b0+30 'simulate 30 degree celcius offset
    if b0>b1 then 'check if storage cell 1 is more than cell 2
    high 3 'open solenoid to transfer
    endif
    let b0=b0-30 'return b0 to true reading

    in picbasic ive written it roughly like this but unsure how to do the readtemp part or i'm possibly completely wrong all together?
    trisb.0=1
    trisb.1=1

    cell1temp var portb.0
    cell2temp var portb.1
    solenoid var portb.3
    start:
    let cell1temp = cell1temp +30
    if cell1temp > cell2temp then
    high solenoid
    endif
    let cell1temp = cell1temp - 30

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: picaxe readtemp function equivalent in picbasic

    Pretty much forget the picaxe stuff. It does not look like picaxe is comparable with PBP.

    Follow the example I linked to for one-wire devices. Bruce gives the best explanation I know of.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: picaxe readtemp function equivalent in picbasic

    MiskaA...

    Here is another example on how to read the DS18B20 temp sensor... or several of them. This example is based on the same code that Mackrackit linked to.

    http://www.picbasic.co.uk/forum/content.php?r=374-How-to-read-a-one-wire-DS18B20-temperature-sensor-or-nine-of-them
    Last edited by Heckler; - 10th October 2011 at 20:33.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

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