set-resolution

wayland/ds18b20/set-resolution

Set resolution of all DS18B20 devices on the bus.
set-resolution
@/set-resolution
Set resolution of all DS18B20 devices on the bus.
DEV@/ds18b20-devices
One or more DS18B20 devices on a single one-wire bus.
RESbyte
Resolution (bits). Options: 9d = 9 bits, 10d = 10 bits, 11d = 11 bits, 12d = 12 bits. If new resolution is out of range, 9 bits is used.
UPDpulse
Update.
set-resolution
DEV
RES
UPD
DONE
DONEpulse
Pulse when resolution set.
To use the node in your project you should have the wayland/ds18b20 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

node {

    void evaluate(Context ctx) {
        if (!isInputDirty<input_UPD>(ctx))
            return;

        auto sensors = getValue<input_DEV>(ctx);
        
        sensors->setResolution(getValue<input_RES>(ctx));

        emitValue<output_DONE>(ctx, 1);
    }
}