Skip to main content

GPIO Demo App: ON/OFF Trigger Example

Updated this week

A simple way to test GPIO-triggered signage behavior in Yodeck


What This App Does

This demo app is a basic HTML App that reacts visually to a Raspberry Pi GPIO input signal.

Specifically:

  • When a switch connected to GPIO pin 4 is turned ON, the app shows a banner/message.

  • When the input is OFF, the message disappears.

It’s a “hello world” of GPIO-based signage — perfect for understanding how content can change based on real-world signals.


Why We Built This

We built this demo app to help:

  • Test GPIO wiring and behavior

  • Show a proof of concept to clients or team members

  • Provide a starting point for more advanced apps


How It Works

  • First, set up the pin configuration (localhost:9999/gpio/config)

  • The app uses Yodeck’s internal local API (localhost:9999/gpio/io) to poll the GPIO pin every 1–2 seconds.

  • It checks the state of GPIO 4.

    • The default state is configured to be OFF, if no circuit is connected to GPIO 4.

  • If the value is 1, it shows content. If 0, it hides it.


How to Use This Demo

  1. Download and Upload the ZIP file as a custom HTML App.

  2. Assign it to a screen

  3. Enable GPIO Input in the screen’s Interactivity tab

  4. Connect your input signal to GPIO 4 and make sure it has a common ground (GND) with the Raspberry Pi.

    • For a quick demonstration, you can use wiring to connect an on/off switch between a 3.3V GPIO pin and the GPIO 4.

  5. Watch the screen respond in real time!


What This App Proves

✅ GPIO integration is working
✅ The app can react to real-time physical input
✅ You can now build your own logic for more complex behaviors


What This App Does Not Do

  • It doesn’t support multiple inputs

  • It doesn’t dynamically pull data or content

  • It’s not built for production use — just testing and learning

Did this answer your question?