set-ambient-pressure

wayland/scd30-co2-rh-temp/set-ambient-pressure

Measurements of carbon dioxide concentration based on the non-dispersive infrared (NDIR) principle are influenced by ambient pressure. Use this node to set the ambient pressure compensation of the SCD30. Ambient pressure value is saved in non-volatile memory. The last set value will be used for ambient pressure compensation after repowering. Setting the ambient pressure will overwrite previous and future settings of altitude compensation. Setting the MBAR input to zero will deactivate the ambient pressure compensation.
set-ambient-pressure
@/set-ambient-pressure
Measurements of carbon dioxide concentration based on the non-dispersive infrared (NDIR) principle are influenced by ambient pressure. Use this node to set the ambient pressure compensation of the SCD30. Ambient pressure value is saved in non-volatile memory. The last set value will be used for ambient pressure compensation after repowering. Setting the ambient pressure will overwrite previous and future settings of altitude compensation. Setting the MBAR input to zero will deactivate the ambient pressure compensation.
DEV@/scd30-device
An SCD30 device.
MBARnumber
Ambient pressure (mBar). Ambient pressure should be in the range 700 to 1200 mBar. Setting MBAR to
UPDpulse
Update. Trigger set ambient pressure compensation.
set-ambient-pressure
DEV
MBAR
UPD
DONE
DONEpulse
Pulses on completion.
To use the node in your project you should have the wayland/scd30-co2-rh-temp 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 `SCD30` class instance
    auto airSensor = getValue<input_DEV>(ctx);

    airSensor->setAmbientPressure(getValue<input_MBAR>(ctx));
    emitValue<output_DONE>(ctx,1);

}