Measurements of carbon dioxide concentration based on the non-dispersive infrared (NDIR) principle are influenced by altitude. Use this node to set the altitude compensation of the SCD30. The altitude compensation setting is disregarded when an ambient pressure is given to the sensor. Altitude value is saved in non-volatile memory. The last set value will be used for altitude compensation after repowering.
set-altitude-compensation
@/set-altitude-compensation
Measurements of carbon dioxide concentration based on the non-dispersive infrared (NDIR) principle are influenced by altitude. Use this node to set the altitude compensation of the SCD30. The altitude compensation setting is disregarded when an ambient pressure is given to the sensor. Altitude value is saved in non-volatile memory. The last set value will be used for altitude compensation after repowering.
DEV@/scd30-device
ALTnumber
Height above sea level in metres.
UPDpulse
Update. Triggers set altitude compensation.
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->setAltitudeCompensation(getValue<input_ALT>(ctx));
emitValue<output_DONE>(ctx,1);
}