question

thomas-koehn avatar image
thomas-koehn asked

Switch GPIO on screen blank

I am using a 5 inch HDMI screen on a RPI 3 which will just turn blue when screen blanking is active. My idea is to switch it off when screen blanking gets activated using a GPIO and a FET. I am able to write some code to do that. Is there a way to trigger that script on screen blanking and again when the screen is supposed to be turned on.

touchscreen
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

1 Answer
Kevin Windrem avatar image
Kevin Windrem answered ·

The screen blanking state appears in a /sys/class/... file. The specific file can be found in /etc/venus/blank_display_device.

You could write a service that reads the /sys/class file periodically and sets the GPIO based on it's value (0 for screen on or 1 screen off).

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources

Additional resources still need to be added for this topic