help!!!!


Closed Thread
Results 1 to 11 of 11

Thread: help!!!!

Hybrid View

  1. #1
    Join Date
    Nov 2006
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    Thanks sayzer...I changed it to a gosub, and it freaked out because when it returns to the loop in still increments scale. So I tried goto calibrated and the LCD at least shows scale=, but it says "scale=r" WTF?

    Here's what I've got. BTW, thanks again for all of your help. I'm already miles ahead just from reading your posts.

    B0 var byte
    scale var byte
    LED var PORTB.1
    Potpin var PORTB.2

    for scale = 1 to 255

    LCDout $FE, 1, "calibrating", $FE, $C0, "Scale=", DEC scale, "B0=", DEC B0
    pot Potpin, scale, B0
    If (B0 > 253) then
    goto calibrated
    endif
    Pause 1000
    next scale

    Lcdout $FE, 1, "Increase R or C"
    stop
    calibrated:
    lcdout $FE, 1, "Scale=", scale

    end

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Possibly you want

    lcdout $FE, 1, "Scale=", DEC scale

    when you jump out, otherwise you get the ASCII equivalent of scale?
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    Nov 2006
    Posts
    32


    Did you find this post helpful? Yes | No

    Talking

    doh! Thanks. Works great! Here's my final code for others to use as reference.

    B0 var byte
    scale var byte
    LED var PORTB.1
    Potpin var PORTB.2

    for scale = 1 to 255

    LCDout $FE, 1, "Wait for Calibration", $FE, $C0, "Current Scale=", DEC scale
    pot Potpin, scale, B0
    If (B0 > 253) then
    goto calibrated
    endif
    next scale

    Lcdout $FE, 1, "Increase R or C"
    stop
    calibrated:
    lcdout $FE, 1, "Use Scale=", DEC scale, $FE, $C0, "Have a nice day"
    high led
    end
    Last edited by champion; - 9th November 2006 at 21:49.

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