Better Pushbutton


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    I'm using 10k pullups. How high should I go?

    Contact resistance is 0.046 ohms and the switch is a very high quality, high reliability switch. The contacts are either closed or not.

    OK, I'll try mister_e's version.

    Thanks!

    ~ Dave

  2. #2
    Join Date
    Jan 2009
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    OK, mister_e's program worked MUCH better .... why is that?

    Thank you once again!

    ~ Dave

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


    Did you find this post helpful? Yes | No

    Default

    Mine don't refresh the PWM duty cycle all the time, it will do IF a push button is pressed.

    The main difference is how the switch debounce is made. Let's use a Google Image

    This is what the signal looks like when you press your switch, the same noise should also appear on the rising edge when you release the switch.

    A little pause after you press on the switch is probably not necessary because your code need some time to execute, but 20mSec for safety sake that's nothing huh?

    If you had more code after the switch detection, you could reduce the second PAUSE.

    HTH
    Steve

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

Similar Threads

  1. USBDemo, something to learn USB a little bit
    By mister_e in forum Code Examples
    Replies: 278
    Last Post: - 1st May 2014, 01:38
  2. Make pushbutton "1" when pressed?
    By Yodoad in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th May 2009, 23:04
  3. one button-two operations
    By savnik in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 20th July 2006, 03:24
  4. Timing the pressing and releasing of a PushButton ?
    By serandre in forum Code Examples
    Replies: 4
    Last Post: - 30th March 2006, 13:43
  5. Pushbutton code routine suggestions?
    By jessey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd September 2005, 02:02

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