none
Read the screen backlight value from officially Raspberry Pi 7" Display RRS feed

  • Question

  • Hello,

    I am trying to get the actual screen backlight value from the official Raspberry 7" Touch LCD. How do I retrieve the brightness value from the screen?
    Here is a Code example which I am trying to get to work:

    public async Task<bool> IsDimmed()
            {
                bool result = false;
                string i2cDeviceSelector = I2cDevice.GetDeviceSelector();
                I2cConnectionSettings i2CConnectionSettings = new I2cConnectionSettings(0x45);
                IReadOnlyList<DeviceInformation> deviceInformationCollection = await DeviceInformation.FindAllAsync(i2cDeviceSelector);
                if (deviceInformationCollection.Count > 0)
                {
                    var i2CDevice = await I2cDevice.FromIdAsync(deviceInformationCollection[0].Id, i2CConnectionSettings);
                    var buffer = new byte[2];
                    buffer[0] = 0x86;
                    try
                    {
                        i2CDevice.Read(buffer);
                        if (buffer[1] < 0xff) result = true;
                        i2CDevice.Dispose();
                    }
                    catch { }
                }
                return result;
            }

    Sunday, January 27, 2019 5:11 PM

All replies

  • Hello Marcus,

    I have tried to find the command to get the touch screen backlight value,but did not find any helpful info about this. There is a topic here, i think you can get some helpful information from IoTGirl mentioned.

    There is not a traditional Windows display driver for RPix. All display rendering is done by VC4 firmware (GPU microcode managed by Pi Foundation).

    Further to Andre's response, the I2c channel between LCD panel and VC4 is not exposed to Windows, because VC4 takes full ownership of that I2c channel.

    Even if it could be accomplished, sharing the same i2c between Windows and VC4 will be problematic. It for sure will break touch functionality.

    Best Regards,

    Michael


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 28, 2019 7:30 AM
    Moderator