get-timing

wayland/tsl2591-light-sensor/get-timing

Get integration time of sensor.
get-timing
@/get-timing
Get integration time of sensor.
DEV@/tsl2591-device
A tsl2591-device.
UPDpulse
Update. Trigger get-gain.
get-timing
DEV
UPD
TIME
DONE
DONEpulse
Pulse on completion.
TIMEbyte
Integration time: 00h = 100ms, 01h = 200ms, 02h = 300ms, 03h = 400ms, 04h = 500ms, 05h = 600ms.
To use the node in your project you should have the wayland/tsl2591-light-sensor library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

node {
    void evaluate(Context ctx) {
        // The node responds only if there is an input pulse
        if (!isInputDirty<input_UPD>(ctx))
            return;

        // Get a pointer to the `Adafruit_TSL2591` class instance
        auto sensor = getValue<input_DEV>(ctx);
        emitValue<output_TIME>(ctx, sensor->getTiming());
        emitValue<output_DONE>(ctx, 1);
    }
}