LTR-308ALS - Luminance Sensor

LTR-308ALS - Illuminance sensor

Illuminance sensor using I2C bus.

Process flow

  1. Wire.begin(): initialize bus 2..begin(): Start sensor operation 3.

  2. wait 50ms

  3. .available() becomes `true

  4. .get_luminance(): read value

Procedures required for operation

Wire bus

Before calling .begin() method, Wire should be put into operation by Wire.begin().

Procedures when returning from sleep mode

Keep the Wire bus in operation just before sleep (the Wire is automatically restored after returning from sleep).

Methods

get_luminance()

Returns an integer value of the illuminance [lx].

Returns -1 on error.

Common methods

setup()

Allocates and initializes a memory area for the sensor.

begin(), end()

Starts acquiring a sensor. Wait about 50ms before reading the sensor value.

Does not support end().

process_ev().

In the case of a sensor with a waiting process, give arg1 E_EVENT_TICK_TIMER or E_EVENT_START_UP to signal the passage of time. If the required time has elapsed after calling this method, it becomes available and the sensor value can be read.

available()

Returns true when the sensor satisfies the read condition.

probe()

Return true when the sensor is connected.

最終更新