0

How can I use HTML/JavaScript to count GPIO triggers from a sensor on a BrightSign player?

Hi all,

I’m working with a BrightSign player and I want to create an HTML-based interface that displays a live count whenever a sensor connected to one of the GPIO pins is triggered. Ideally, this would be a live counter shown in a browser view using HTML and JavaScript.

My questions:

  • How do I listen for GPIO input changes using HTML/JavaScript on BrightSign?
  • Are there examples of this kind of live counter setup? 

Any guidance or examples would be greatly appreciated!

Thanks in advance!

1 comment

  • 0
    Avatar
    Sherri Labrecque

    To create a live counter on a BrightSign player using HTML/JavaScript triggered by a GPIO sensor, you'll need to configure the sensor's GPIO pin as an input in BrightAuthor:connected. Within your HTML file, use JavaScript to instantiate the BSControlPort object, then attach an event listener to its oncontroldown event for the relevant GPIO pin. When the sensor triggers this www smartsquarehmh com event, increment a JavaScript variable and update the content of an HTML element (div or span) to display the live count. Debugging can be done via the BrightSign player's web-based console at its IP address.

Please sign in to leave a comment.