# LightSensor

LightSensor is a non-visible component that measures the ambient light level (illumination) in lx.

**Event-handler block.** Event is triggered when a sensor change occurred

![](https://3777451846-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L93-jOwVwLojc0B0kcn%2F-LGrJWwYJ6ciDFA5Eevu%2F-LGrKQJzE7fBgLWMDkOF%2Fimage.png?alt=media\&token=150e0a71-c18b-426b-889d-c88bec5c9813)

**Properties block.**

LightSensor includes following properties-blocks. They allow you to determine if user's device has this type of sensor or enable / disable this sensor.

![](https://3777451846-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L93-jOwVwLojc0B0kcn%2F-LGrJWwYJ6ciDFA5Eevu%2F-LGrM2ukCBZoWUqmO3Ft%2Fimage.png?alt=media\&token=aaf93949-04da-49bf-a2e8-33a8e72a74c1) ![](https://3777451846-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L93-jOwVwLojc0B0kcn%2F-LGrJWwYJ6ciDFA5Eevu%2F-LGrNTcuQg7HuM3n9tUg%2Fimage.png?alt=media\&token=a893da93-f16a-4fef-a358-4ab9447a4574)

Example

In Screen initialize , you can check if LightSensor is available or not. You can use block LightSensor.LightChanged to determine the sensitivity of light changed in lx unit:

![](https://3777451846-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L93-jOwVwLojc0B0kcn%2F-LGuYL8RGM6o4a-unyGo%2F-LGuYPwFlmv1CDkLfIXp%2F6a6d31b9-5a91-4f26-8562-2924ec75ffde.jpg?alt=media\&token=1c52bd44-53a8-48ab-a813-c355d30ca226)

![](https://3777451846-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L93-jOwVwLojc0B0kcn%2F-LGuNrQn8dpu8GWnpY84%2F-LGuQZSUuxtyKaQGfsTD%2Fimage.png?alt=media\&token=da2a7349-7a9e-4946-b4dd-05912361b60d)
