output's on as power is supplied


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tazntex View Post
    keydata VAR b3 'relay number storage variable

    IF keydata => 1 AND keydata <= 12 THEN GOTO keyed 'goto keyed if key is 'pressed
    And again...b3 does not make any sense.
    When you define a variable, you define it as a type; a bit, a byte, a word, a bucket, a scoop of ice cream, a car, whatever...

    What exactly is a b3?

    And again...in the If/Then, you GOSUB into the LOOP1, and then you GOTO out of LOOP1 back to the main loop. When you GOSUB, you push a return address onto the stack (i.e. a place to remember where I was before, look up GOSUB and RETURN in the manual), and from there, you must RETURN out of it. If you GOTO out of a GOSUB, you keep remembering where you were, but you'll never forget. A PIC only has so many empty spaces to remember, and by RETURNing, you free up one of those spaces. If you never RETURN, eventually, you won't remember either.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    And again...b3 does not make any sense.
    When you define a variable, you define it as a type; a bit, a byte, a word, a bucket, a scoop of ice cream, a car, whatever...

    What exactly is a b3?
    B3 is defined in the "bs2defs.bas" INCLUDE file.

    It's an alias to W1.HIGHBYTE. W1 is also defined there as a WORD.
    <br>
    DT

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    B3 is defined in the "bs2defs.bas" INCLUDE file.
    It's an alias to W1.HIGHBYTE. W1 is also defined there as a WORD.
    <br>
    Ahhh...that covers why it compiles with errors...

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    2nd round
    IT COMPILE WITHOUT ERROR, IT'S DEFINED IN THE BS2DEFS.BAS file.

    unless you removed the INLCUDE "BS2DEFS.BAS" linet, IT WILL COMPILE WITHOUT ERROR.

    Once again ?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Battery powered applications
    By NavMicroSystems in forum Off Topic
    Replies: 7
    Last Post: - 22nd June 2009, 07:12
  2. Pic getting part power from Analog Port
    By ShaneMichael in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 22nd April 2009, 10:34
  3. Outputs high to power
    By volcane in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd February 2008, 18:29
  4. 12 Servo's together does not seem to work, Power problem
    By macx75 in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th December 2006, 19:30
  5. Power up problem
    By Ken McDonald in forum General
    Replies: 1
    Last Post: - 28th December 2004, 17:06

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