Pin as variable?


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Jul 2010
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    myPin = PORTB.1
    Read the state of the pin and stores the value to myPin.

    HIGH myPin
    Is for making a pin HIGH.

    So the way you want to do it will not work.
    Yes, I know it wont work, that's why I am asking if there is a way to do something like that.

    The only way I see to do what you want is to use an IF/THEN/ELSE block with three condiitons or CASE SELECT with three conditions.
    Right, that's what I said in my previous post. I want to avoid using CASE or IF/THEN blocks because of the number of times I have to invoke the PIN in the routine (In my actual code I don't have just 3 conditions). It is just not practical to have so much redundant code as I need the space for other things.

    Thank you anyway, I appreciate your taking the time to look at my problem
    Last edited by dream-; - 15th September 2010 at 22:34.

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


    Did you find this post helpful? Yes | No

    Default

    Do not give up. Darrel came to the rescue again with the link he posted.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jul 2010
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Do not give up. Darrel came to the rescue again with the link he posted.
    Yes, and I already implemented it!. Works like a charm.

    Thank you guys again!

    (One happy camper glad he didn't have to recode everything in C)

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