set-pulse-amplitude-red

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

Set pulse amplitude of red LED.
set-pulse-amplitude-red
@/set-pulse-amplitude-red
Set pulse amplitude of red 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 red LED.
set-pulse-amplitude-red
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->setPulseAmplitudeRed(getValue<input_AMP>(ctx));
    emitValue<output_DONE>(ctx,1);
}