0

Ls422 and GPIO button trigger event

Hi, I have a Ls422 and connected GPIO 0 to a micro switch to play a video.  I have the switch working but I can not get the Press Continuous to work.  I have set the repeat interval to 1000 milisecs for 1 second.  When I activate the switch it immediately plays my video. How can I get it to play the video after the button has been down for more than the repeat interval?  I have used the button up event but would rather used the button down for an interval.  Thanks

1 comment

  • Avatar
    Yuriy Official comment

    Hi Gary,

    Press Continuous option isn't usually utilized for changing between states, it's made for things like volume control and such, emulating repeated button presses.

    Instead, there's a workaround imitating a button held down, take a look at the presentation linked below (made in BrightAuthor 4.6.0.15).

    In this presentation we switch between the images when GPIO button 1 is pressed during 3 seconds.

    Presentation consists of two zones.
    Audio zone includes two event handlers.
    Switch between event handler 1 to event handler 2 occurs via GPIO 1 (Down). This imitates button press.
    Switch between event handler 2 to 1 occurs via GPIO 1 (Up) - imitates button release.
    If button 1 is pressed during 3 seconds, transition from event handler 2 to handler 1 occurs and zone message 'fire' is sent (timeout event is responsible for this -- see properties of timeout event, advanced tab).

    Switch between images in zone 1 occurs via zone message 'switch' which is sent from timeout event in zone 2.
    As the result the images in zone 1 switch only when GPIO 1 is pressed during 3 seconds.

    Hope this helps.

    https://www.dropbox.com/s/t0jyjhmqq3ltx13/sample.zip?dl=0 

Please sign in to leave a comment.