KG2V
Posts: 9
Joined: Fri Jan 08, 2021 4:25 pm

.Net Core 3.x, Display Brightness

Fri Jan 08, 2021 4:45 pm

Hi folks,
I'm looking to adjust the display brightness (official display, current rev) on Raspian, using .NET core 3.x

Anyone have any clue how to do this? I've seen various other languages, and there doesn't seem to be a .NET core/Raspian group here (just win10IoT (not going there ever again)

Thanks
Charlie

ProjectMayu
Posts: 30
Joined: Sun Jul 01, 2012 8:58 am

Re: .Net Core 3.x, Display Brightness

Thu Jan 14, 2021 7:49 pm

Have a look in the folder /sys/class/backlight/rpi_backlight/ and just google the full path to any file in there to find documentation

Try /sys/class/backlight/rpi_backlight/actual_brightness
use 0 to 255

return Byte.Parse(System.IO.File.ReadAllText("//sys//class//backlight//rpi_backlight//actual_brightness"));

and

System.IO.File.WriteAllText("//sys//class//backlight//rpi_backlight//actual_brightness", value.ToString(), Text.Encoding.GetEncoding(1252))

KG2V
Posts: 9
Joined: Fri Jan 08, 2021 4:25 pm

Re: .Net Core 3.x, Display Brightness

Tue Jan 26, 2021 7:23 pm

Trying to change the file, (using nano as sudo) and you can't write to the file. Joy

Return to “Other programming languages”