- Accelerometer
- Compass
- Geolocation
- Gyrometer
- Inclinometer
- Light Sensor
- Orientation Sensor
Light Sensor
The ambient light sensor detects the quality and intensity of light in the device’s environment. This enables your application to adjust the display, such as reducing the brightness when the user is in a dark environment. Reducing the brightness of the display can prolong the battery life for the device.
Listing 4.9 demonstrates reading values from the light sensor.
Listing 4.9: Reading the Light Sensor
async private void ReadingChanged(object sender, LightSensorReadingChangedEventArgs e) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { LightSensorReading reading = e.Reading; ScenarioOutput_LUX.Text = String.Format("{0,5:0.00}", reading.IlluminanceInLux); }); }
You can learn more about the light sensor online at http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.sensors.lightsensor.aspx.