set-resolution

wayland/sdp6x-pressure-sensor/set-resolution

Set resolution of SDP6x sensor. For further information on the resolution of SDP600 series sensors, please see: https://sensirion.com/media/documents/1BA19F23/6166C545/Sensirion_Differential_Pressure_AppNotes_SDP600Series_Changing_Measu.pdf
set-resolution
@/set-resolution
Set resolution of SDP6x sensor. For further information on the resolution of SDP600 series sensors, please see: https://sensirion.com/media/documents/1BA19F23/6166C545/Sensirion_Differential_Pressure_AppNotes_SDP600Series_Changing_Measu.pdf
DEV@/sdp6x-device
An SDP6x device.
RESnumber
Resolution (bits). Options: 9, 10, 11, 12, 13, 14, 15 and 16. For most applications, Sensirion recommends 12 bit resolution (default setting) in order to combine excellent accuracy with fast response time. After each hard reset or soft reset of the sensor, the default resolution is restored.
UPDpulse
Update.
set-resolution
DEV
RES
UPD
DONE
DONEpulse
Pulse on completion.
To use the node in your project you should have the wayland/sdp6x-pressure-sensor 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

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_UPD

node {

    void evaluate(Context ctx) {
       // The node responds only if there is an input pulse
       if (!isInputDirty<input_UPD>(ctx))
           return;

        auto sensor = getValue<input_DEV>(ctx);
        auto res = getValue<input_RES>(ctx);

        if (res==9) {
            sensor->SetSensorResolution(RESOLUTION_9BIT);
            emitValue<output_DONE>(ctx, 1);
        }

        if (res==10) {
            sensor->SetSensorResolution(RESOLUTION_10BIT);
            emitValue<output_DONE>(ctx, 1);
        }

        if (res==11) {
            sensor->SetSensorResolution(RESOLUTION_11BIT);
            emitValue<output_DONE>(ctx, 1);
        }

        if (res==12) {
            sensor->SetSensorResolution(RESOLUTION_12BIT);
            emitValue<output_DONE>(ctx, 1);
        }

        if (res==13) {
            sensor->SetSensorResolution(RESOLUTION_13BIT);
            emitValue<output_DONE>(ctx, 1);
        }

        if (res==14) {
            sensor->SetSensorResolution(RESOLUTION_14BIT);
            emitValue<output_DONE>(ctx, 1);
        }

        if (res==15) {
            sensor->SetSensorResolution(RESOLUTION_15BIT);
            emitValue<output_DONE>(ctx, 1);
        }

        if (res==16) {
            sensor->SetSensorResolution(RESOLUTION_16BIT);
            emitValue<output_DONE>(ctx, 1);
        }
    }
}