Problem getting button to turn on LED using 12F675


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Problem getting button to turn on LED using 12F675

    Quote Originally Posted by Jeff View Post
    Thanks guys, you were both right; rookie mistake on my part. It works now - onward and upward. Now the button turns on LED2 and off LED1. SWEET!
    Welcome back Jeff,
    3 years almost. I think what trips up people is this statement,
    CMCON = $?? 'MAKE PINS DIGITAL
    Which seems to reappear on a regular basis, perhaps copy paste, it should more factually report,
    CMCON = $?? 'Disable input Comparators
    The ANSEL is the 'MAKE PINS DIGITAL part of the equation, as you found out, My post here is for the future newbies who read this post.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  2. #2
    Join Date
    Jun 2008
    Location
    Spokane, WA
    Posts
    9


    Did you find this post helpful? Yes | No

    Smile Re: Problem getting button to turn on LED using 12F675

    Quote Originally Posted by Archangel View Post
    Welcome back Jeff,
    3 years almost. I think what trips up people is this statement,
    CMCON = $?? 'MAKE PINS DIGITAL
    Which seems to reappear on a regular basis, perhaps copy paste, it should more factually report,
    CMCON = $?? 'Disable input Comparators
    The ANSEL is the 'MAKE PINS DIGITAL part of the equation, as you found out, My post here is for the future newbies who read this post.
    3 years...yes, i probably gave up for 3 years because of this. Also, i was using picbasic, not pro. Pro is SOOOOO much easier. it is worth the lute. I was struggling with the stupid button command for a couple weeks and gave up. Then i read Chuck Hellebuyck's book; "Programming PI uC's with picbasic" and he mentioned a workaround by directly addressing memory. I am finally starting to 'get it'. Thanks.

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Problem getting button to turn on LED using 12F675

    Glad to see you back, You are right, PBP IS worth the extra money.
    I think the Button command is overly complicated vs 2 ifs, but maybe it saves codespace? Anyway keep on coding, the forum is here when you need it.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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