set-resolution

wayland/mcp9808-thermometer/set-resolution

Set resolution mode of MCP9808 device. Four modes are available (resolution and sample time in parentheses): 00h ( 0.5°C , 30 ms); 01h (0.25°C, 65 ms); 02h (0.125°C, 130 ms); 03h (0.0625°C, 250 ms).
set-resolution
@/set-resolution
Set resolution mode of MCP9808 device. Four modes are available (resolution and sample time in parentheses): 00h ( 0.5°C , 30 ms); 01h (0.25°C, 65 ms); 02h (0.125°C, 130 ms); 03h (0.0625°C, 250 ms).
DEV@/mcp9808-device
A MCP9808 device.
RESOLUTIONbyte
Resolution mode. Choose from following options (resolution and sample time in parentheses): 00h ( 0.5°C , 30 ms); 01h (0.25°C, 65 ms); 02h (0.125°C, 130 ms); 03h (0.0625°C, 250 ms).
UPDpulse
Update. Trigger set-resolution.
set-resolution
DONE
DEV
RESOLUTION
UPD
DONEpulse
Pulse on completion.
To use the node in your project you should have the wayland/mcp9808-thermometer 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 `Adafruit_MCP9808` class instance
    auto sensor = getValue<input_DEV>(ctx);
    uint8_t resolution = getValue<input_RESOLUTION>(ctx);
    sensor -> setResolution(resolution);
    emitValue<output_DONE>(ctx, 1);
}