Light Sensor

  • Description

      Light Sensor

      The light Sensor is a not visible component that is sensitive to changes of light. For this sensor to work it has to have the device. We can know if the device has the sensor with the property 'Available'.

  • Events

    • OnAccuracyChanged
    • Event that is executed when it is detected that the accuracy with which the sensor captures the light changes. This event is useful if you want to only run certain actions with a high accuracy, for example. The accuracy usually depends on the quality of the sensor of the device.
    • OnSensorChanged
    • Event that runs when the sensor detects a change in the illuminance.
  • Properties

    • Accuracy
    • It allows to determine the accuracy with which our device captures the brightness.
    • Available (boolean)
    • Allows you to determine if the device has light sensor or not, if it is 'True' the device will have.
    • Lux (nĂºmero decimal)
    • This property returns us to the lighting obtained in Lux units. For example 10 lux.
  • Example

    • Getting the brightness
    • When there is a change in the illuminance, the sensor of the device detects it and triggers the event 'OnSensorChanged'. This event will provide us with the illuminance in Lux units, this is represented in decimal numbers. For example luminosity: 4.00 Lux.