0

Hold button for x seconds to go to previous state

Hi,

I'm new to BrightSigns, I am trying to create a simple presentation that plays a video when a button is pressed and goes back to the previous state when the button is held for 5 seconds. I tried press continuous 5000 milliseconds hoping that it would do it, but that didn't work. I am programming it for the HD222. Anyone have any ideas? 

4 comments

  • 0
    Avatar
    JRB Technical

    I have tried a couple possible tricks, but nothing really works to get the behavior that you want with BrightAuthor on it's own.

    Assuming you are using GPIO and have 2 GPIO's available, you could use one of the mini or micro Arduino's. Have the push button connected to the Arduino, and the 2 outputs on the Arduino connected to 2 GPIO's on the BrightSign. One GPIO to play the video, and the other to go back to the previous state. Then program the Arduino to trigger GPIO 1 on Button Press, and trigger GPIO 2 if Button Held for 5 seconds.

    You could do the same with Time Delay relays, but they are expensive compared to the cost of an Arduino, and you have more flexibility with the Arduino. 

  • 0
    Avatar
    Brandon

    You can use GPIO Press Continuous, a user variable, and Conditional targets.

    Press Continuous triggers at the initial press then repeats as long as the button is still held after the interval. So we need to not act until the second time it triggers.
    We can use a variable for that.

    1. Define SecondPress as a variable with default value of 0 in Presentation Properties, Variables tab.

    2. Put a GPIO button down, press continuous 5000 ms on your video, Remain on Current state.

    3. In the Advanced tab of the state, click Conditional targets, then add two conditional targets:
      a. If SecondPress < 1, Remain on Current state, in Advanced, Other>Set Variable SecondPress 1
      This will tell us later that we've already seen the initial press event.
      b. If Second Press is greater than or equal to 1, Return to previous state, in Advanced, Other>Reset Variable SecondPress
      This will return us to the previous state and reset the variable so it's ready for the next round.

    4. The above takes care of the desired behavior, BUT, it also has a side effect - if the viewer presses the button for less than 5 seconds, then presses it again we'll get taken to the previous state.
      So we need to also reset the SecondPress variable when the button is released.
      Add a GPIO Button Up event, Remain on Current state, in Advanced, Other>Reset Variable SecondPress That will reset things if the viewer releases the button early so that press is essentially ignored.
  • 0
    Avatar
    Davy Whiteley

    I need to do exactly the same thing, I followed the instructions, I understand why it should work but it doesn't.

    As soon as I press the button the video goes back to previous state. Any ideas ? 

    I'm using a HD224, only thing different with this tutorial is that "Other > Reset variable" is not in "Advanced" but in "Commands"

  • 0
    Avatar
    Brandon

    Sounds like either your user variable isn't being set/reset or you have the main action for the GPIO Button Down event set to other than Remain on current state.

    _________________________________________________________________________
    Friendly reminder, the community forum is intended for user-to-user discussion.  It is not regularly monitored. For troubleshooting problems and to ensure a timely answer from a BrightSign representative, please submit a support ticket

Please sign in to leave a comment.