No announcement yet.

Auto-Repeat on Momentary Pushbutton

  • Filter
  • Time
  • Show
Clear All
new posts

  • Auto-Repeat on Momentary Pushbutton

    The user interface I am designing has a requirement that two of the momentary pushbutton switches must supply "repeating" switch closure messages if the momentary switch is pressed and held down (held pressed) for more than 700 mSec. When the switch is pressed, it should immediately send a closure message. If the switch is held in the pressed position for more than approximately 700 mSec, the switch should send additional switch closure messages at a repeat rate of one message every 500 mSec. until the switch is released, at which time the switch closure messages should stop being sent.

    I am using the uLCD-70DT display. Is there any way to meet this requirement with Visi-Genie or any of the other WS4 development environments?

    Thanks for your assistance with this question.


  • #2
    Use a momentary switch and set momentary to 'Both'.

    Then you will get a message when the switch is pressed and again when it is released.

    You then do all the timing related stuff in your controller.

    When Push received start timer at 700ms, every pop of the timer do a repeat and set the timer to 500ms.
    When Release received top timer


    • #3
      I should probably explain in a little more detail what I am trying to accomplish with the button auto-repeat capability. The user interface controls a stepper motor. There is a button for clockwise rotation of the stepper and another button for counterclockwise rotation. If the clockwise button is pressed and released, the stepper motor should advance one step clockwise and stop. If the clockwise button is pressed and held, the stepper motor should advance one step in the CW direction when the button is first pressed and then after 2 seconds, the motor should start running continuously at low speed and then after 4 seconds, the stepper motor should run continuously at high speed. The stepper motor should continue running at high speed until the button is released, at which time the motor should stop.

      I hope this description helps explain my need for the auto-repeat function on the momentary button.