One analog Pin - fed from 5 way joystick tactile switch - with interrupt?


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Hi Hank, not sure why you can't just poll the A/D, but heres an idea. If your chip has compare on the same pin(s) as A/D (like '877) set the comparater up to interupt when any switch is pressed. then switch to A/D on that pin and read the value. after switch back to comp and wait.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cncmachineguy View Post
    Hi Hank, not sure why you can't just poll the A/D, but heres an idea. If your chip has compare on the same pin(s) as A/D (like '877) set the comparater up to interupt when any switch is pressed. then switch to A/D on that pin and read the value. after switch back to comp and wait.

    Re using a comparator - that's a mighty fine idea.

    re polling ......not sure I've totally understood what you're getting at (I'm still a n00b at heart!), do you mean constantly poll the analogue pin connected to the nav switch to see if there's been a meaningful change in voltage? (thereby meaning a switch has been pressed) If so, my program already has a good few loops with 'pause' commands gratuitously used throughout.

    I guess during the waiting periods (ie pauses), I could be checking the incoming switch potential divider level to check for a change in voltage ....maybe it's my poor programming approach, but I've always has snappier results with interrupts (vs polling)

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