read-raw

wayland/max30102-pulse-oximeter/read-raw

Read red and infrared values.
read-raw
@/read-raw
Read red and infrared values.
DEV@/max30102-device
A MAX30102 device.
UPDpulse
Update. Trigger new reading.
read-raw
DEV
UPD
RED
IR
DONE
DONEpulse
Pulse on completion of read.
IRnumber
Infrared value.
REDnumber
Red value.
To use the node in your project you should have the wayland/max30102-pulse-oximeter 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

struct State {
};

{{ GENERATED_CODE }}

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 `MAX30102` class instance
    auto sensor = getValue<input_DEV>(ctx);

    emitValue<output_RED>(ctx,sensor->getRed());
    emitValue<output_IR>(ctx,sensor->getIR());
    emitValue<output_DONE>(ctx,1);

}