No announcement yet.

Accelerating button Visi-Genie

  • Filter
  • Time
  • Show
Clear All
new posts

  • Accelerating button Visi-Genie

    Hello Everyone,

    I was making a form for one of our projects using a Diablo based screen and the visi-genie pro environment and I was wondering if is it possible to make a button able to accelerate when touched, I mean, I want the button to not only do an action such as send a report to the host when touched but also to keep track of how much seconds it has been pressed and increment a counter in concordance with this time, or at least send a report message that reflects this time.

    I was thinking about the Magic objects such as the magic event or combining both the touch and release magic object but I am not very clear about it, maybe you could help to reach an optimal solution.

    Best regards.

  • #2

    Thank you for the information.

    One way, you could use MagicTouch and the MagicRelease to keep track the time of the button been pressed.

    With regards to the timing, it will need two MagicCode with InsertPoint: a Constant/Global/Data and a MainLoop for the timing function.

    Also, it would highly depend on the application you have intended to do.

    For your reference, I have attached a sample demo.

    Hope this gives you some idea. Thanks

    Warmest regards,
    Attached Files


    • #3
      if your using a host mcu, set the button to “BOTH” in genie
      when you press the button youll get the event value for it as bool 1. when you let go, the button’s event will report value 0. use the press action to reset a millis() counter, then when the button is depressed, simply do a millis() - variable which would return the time pressed



      • #4
        I agree with you, tony.


        • #5
          Thank you so much for the help and the example, and to Tony for the advice.
          I actually control the screen as a kind of slave and I have programmed the screen to send a custom serial command to the host each 500, 200 or 100 ms that the button is pressed, according to the time that the button has been pressed, and the host updates the field corresponding to that button (I have to it that way because of the application security) and it works really well.

          Cheers, Eduardo


          • #6
            You're welcome!

            I'm glad to know that you managed your concern.

            If you have further concerns, please don't hesitate to ask.