How can I read a port's status


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2008
    Posts
    15

    Default How can I read a port's status

    I am a newbee at this and have a simple program that works great. The program switches on a led at the beginning of the program, but what i need is if the led is on at the end of the program, is there anyway to look at that led output port and tell the program to run the next program. The only way I can think of this is to take another input port and tie it to the led port to sample if the led is on and use that input to trigger the sub program. Any Ideas?

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    You can READ the state of a pin anytime. Even if it is configured as an output.
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    I do not understand exactly what you are after.
    The only way the LED could be on is if you turned it on or off for that matter.

    So you would know if it is on....If you turned it on then???
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Cleaning up code
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2009, 07:14
  2. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  3. Help needed - PIC12F635- MCU does not read Ports
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 15th January 2009, 12:03
  4. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 06:34
  5. Read value of digital ports
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th July 2005, 11:11

Members who have read this thread : 1

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