Is there a way to add screen brightness capability to a RaspPi5 using XOJO?
Could either be a way to control brightness to completely black screen and then re-enable normal screen brightness when screen is touched.
This would essentially create a screen saver inside XOJO (no shell calls) capability to prevent screen burnout - color burn in on a touch screen?
Could you show a full screen window that was simply black?
I was thinking of that but it seemed like a bandaide verses a solution. Was looking more for a programmatic way to go from normal brightness to dark using a timer.
there are two things - automatic display off after some time passed (but I guess it is not what You are looking for) and screen dim.
In case of LCD screen there is no burnout - just backlight wearing out. I have no idea how to prevent it / reduce brightness from Xojo.
In case of OLED screen You can prevent burnout by reducing brightness of whatever is displayed this way:
create Your window with all the controls etc as you need
create filled rectangle object in size of screen and put it on top of everything
set its visibility to false
set its colour fill to something like &c00000030 (little transparency)
add timer MyTimer and set its run mode to single, period to whatever you want, like 10 minutes
add FocusReceived event to any control on that window and put this inside:
MyTimer.reset
in MyTimer.Action event set that big filled rectangle visibility to true.
In MouseDown event of big filled rectangle set me.visible=false
DerkJ
(DerkJ)
September 6, 2024, 10:16am
5
You can change backlight via terminal, bit only for displays that support it. Most hdmi screens wont support it.
https://raspberry-projects.com/pi/pi-hardware/raspberry-pi-touch-display/backlight-control-software
You can however enable, disable, activate and deactivate a display blanking.
Hdmi screens:
vcgencmd display_power 0
And
vcgencmd display_power 1
USE a shell, you need the full path to vcgenmcd find it trough your raspberry terminal using “whereis vcgencmd”
MarkusR
(MarkusR)
September 6, 2024, 11:07am
6
test if you have this installed or any other command line tools for this purpose.
/sys/class/backlight/rpi_backlight/brightness
i guess you will end up in shell calls from within xojo.
i prefer that the os handle this screen dim somehow global and not a single app.