Skip to content

Instantly share code, notes, and snippets.

@BYK
Created December 29, 2025 15:08
Show Gist options
  • Select an option

  • Save BYK/e30c4fa1edac923d2ecbdb9a16d30bf5 to your computer and use it in GitHub Desktop.

Select an option

Save BYK/e30c4fa1edac923d2ecbdb9a16d30bf5 to your computer and use it in GitHub Desktop.
Light Sensor Data - Windows
# 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