ds18b20-devices

wayland/ds18b20/ds18b20-devices

Create DS18B20 device(s) on a one-wire bus.
ds18b20-devices
@/ds18b20-devices
Create DS18B20 device(s) on a one-wire bus.
OWB@/one-wire-bus
One-wire bus.
ds18b20-devices
DEV
OWB
DEV@/ds18b20-devices
One of more DS18B20 devices on a single one-wire bus.
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

#pragma XOD require "https://github.com/milesburton/Arduino-Temperature-Control-Library"

#include <DallasTemperature.h>

node {
    meta {
        using Type = DallasTemperature*;
    }

    uint8_t mem[sizeof(DallasTemperature)];

    void evaluate(Context ctx) {
        if (!isSettingUp()) return;

        auto ow = getValue<input_OWB>(ctx);

        Type sensors = new (mem) DallasTemperature(ow);

        sensors->begin();

        emitValue<output_DEV>(ctx, sensors);
    }
}