Count button presses


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If you have only 1 push button, you could use an internal timer/counter. This one will increase each time you press on the switch (may need some external debouncing). You could also use an interruptible pin, says INT0, and within your ISR, you increase your counter value and process the Debouncing.

    A timer interrupt, or polling a timer overflow to check the Counter value, and you're all set.
    Last edited by mister_e; - 4th May 2009 at 15:59.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Nov 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    I will try the example above. If anyone else has any other suggestions please let me know.

Similar Threads

  1. Sony SIRC IR Issue
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th August 2015, 08:10
  2. COUNT is not counting again
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 19th June 2009, 04:52
  3. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  4. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  5. Button Push within 3 second Window
    By Tissy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd December 2005, 10:06

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