IF-THEN issue


Closed Thread
Results 1 to 6 of 6

Thread: IF-THEN issue

Hybrid View

  1. #1
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: IF-THEN issue

    Jump into the subrountine, run that code once, jump out, if the pin turns low, the led stays on because the IF THEN code isnt being run. Therefore there has to be IF THEN code in the main program loop to detect if PORTB.7 = 0 and turn off the LED and send 0 to the POT.

  2. #2
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: IF-THEN issue

    Very interesting. In your main code you have an IF statement to detect PORTB.7 =1 and another IF statement to detect PORTB.7=0.

    or you could just call the subroutine from the main program as it does both checks.

Similar Threads

  1. DS1307 issue
    By Scampy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 30th October 2013, 14:54
  2. I2C issue
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 18th October 2011, 23:53
  3. 12F675 - another issue
    By fratello in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 26th August 2011, 20:26
  4. Code Issue - select case or 'if' issue - not sure why
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th October 2007, 09:52
  5. 16F877A issue
    By DynamoBen in forum Off Topic
    Replies: 9
    Last Post: - 31st August 2007, 05:15

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