Temperature does not go below 0


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: Temperature does not go below 0

    Quote Originally Posted by AvionicsMaster1 View Post
    I'm a novice programmer but aren't you supposed to RETURN from a sub then GOTO a different subroutine? Most of your FNDx routines GOTO a sub for a RETURN. The first FND is empty. The blinking LED would tell you if the program is stuck somewhere.

    In DIGITCALC won't the variable N always be a negative number? If so PicBasic will always report that as a zero.

    Hope it helps and I don't get flamed too much?
    His code is messy with no comments and lots of spaces so it does make it hard to follow, but there is a FND start and finish.

    Code:
    FND8:
    IF DIGIT>8 THEN FND9
    DG=$7F                       '%0111 1111      
    GOTO FNDEND
    
    FND9:
    DG=$6F                       '%0110 1111      
    
    FNDEND:
    RETURN
    Basically the program go's to the subroutine FND, which then contains a lot of IF DIGIT statements and if it is above a value then jump to the next FNDx label, but if it equals that value then set set value for DG and goto FNDEND, which is a simple RETURN and thus closes the subroutine.

  2. #2
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Temperature does not go below 0

    Thanks for the schooling. I see it now. Though it would be interesting to know if it indicates anything other than zeroes.

    I usually use the LED blinking to help me know when I've done something less than desirable. Just add a TOGGLE to the main loop and a short pause will let you know if the program's hung.

    Best of luck.

Similar Threads

  1. IR Temperature Sensor
    By TravisM in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 23rd October 2012, 15:04
  2. read temperature
    By breeno in forum General
    Replies: 16
    Last Post: - 6th October 2010, 12:55
  3. Temperature Logging
    By tonyfelloni in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 18th June 2008, 10:29
  4. Temperature Meter
    By Mohammed Mazed in forum Schematics
    Replies: 3
    Last Post: - 18th December 2006, 02:12
  5. temperature controller
    By PoTeToJB in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th April 2006, 20:01

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