set-pulse-amplitude-ir

wayland/max30102-pulse-oximeter/set-pulse-amplitude-ir

Set pulse amplitude of IR LED.
set-pulse-amplitude-ir
@/set-pulse-amplitude-ir
Set pulse amplitude of IR LED.
DEV@/max30102-device
A MAX30102 device.
AMPbyte
Amplitude. Values: 0x00 = 0mA, 0x7F = 25.4mA, 0xFF = 50mA (typical).
UPDpulse
Update. Trigger for setting pulse amplitude of IR LED.
set-pulse-amplitude-ir
DEV
AMP
UPD
DONE
DONEpulse
Pulse on completion.
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 `MAX30105` class instance
    auto sensor = getValue<input_DEV>(ctx);

    sensor->setPulseAmplitudeIR(getValue<input_AMP>(ctx));
    emitValue<output_DONE>(ctx,1);
}