Created
December 29, 2025 15:08
-
-
Save BYK/e30c4fa1edac923d2ecbdb9a16d30bf5 to your computer and use it in GitHub Desktop.
Light Sensor Data - Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # uv pip install --system winrt-Windows.Foundation winrt-Windows.Devices winrt-Windows.Devices.Sensors | |
| import winrt.windows.devices.sensors as ws | |
| lightSensor = ws.LightSensor.get_default() | |
| while True: | |
| print(lightSensor.get_current_reading().illuminance_in_lux) | |
| sleep(.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment