EasyManua.ls Logo

Element14 mi:node - Page 12

Default Icon
32 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
User Manual V3.1
Element14 | element14.com/minode 12
Module
Connect Type
Available Connectors
Light Sensor
Analog
A0, A1, A2
Electrical Characteristics
Parameter
Min.
Typical
Max.
Unit
Photoresistor (light intensity is 10lux)
5
-
10
kohm
Threshold hysteresis ΔUth
-
VCC*0.09
-
V
Block API:
Obtaining the Light Level
The light sensor module divides brightness into five distinct levels, 1 5, with one being
the brightest and five being the most dull.
Function
LightSensorGetLevel(connName: AnalogConnName): number;
Parameters
‘ConnName is the analog connector's name.
Light Sensing Event
This function is used to check the light level periodically and then execute the associated
code block whenever the light level changes.
Function
onLightSensorEvent(connName: AnalogConnName, body: () => void): void;
Parameters
‘ConnName is the analog connector's name.
EXAMPLE:
Display Light Level