Not TestedTesting not done, may not work properly
Device & Sensors

Ambient Light Sensor

Read ambient room illuminance levels in Lux units.

Checking support...
Advertisement

Interactive Input Workspace

Ready for input

Web API Execution Output

Result output will be displayed here after processing...

Native JavaScript Code Example (Zero Libraries)

if ('AmbientLightSensor' in window) {
  const sensor = new AmbientLightSensor();
  sensor.onreading = () => console.log(sensor.illuminance);
  sensor.start();
}

About the Ambient Light Sensor Web API

AmbientLightSensor interface returns current light intensity in Lux.

Specification:W3C & WHATWG Web API Standard
Sponsored Content