sdp6x-device

wayland/sdp6x-pressure-sensor/sdp6x-device

Create an SDP6x device.
sdp6x-device
@/sdp6x-device
Create an SDP6x device.
I2Cxod/i2c/i2c
I²C bus
SFnumber
SCALE FACTOR. N.B. you need to set the scale factor to the appropriate value for your sensor: SDP6xx-500Pa and SDP5xx=60.0; SDP6x0-125Pa=240.0; SDP6x0-25Pa=1200.0.
sdp6x-device
I2C
SF
DEV
DEV@/sdp6x-device
An SDP6x device.
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 require "https://github.com/WaylandM/Sensirion_SDP6x_pressure_sens"

#include <Wire.h>
#include <SDP6x.h>

node {
    meta {
        using Type = SDP6xClass*;
    }

    uint8_t mem[sizeof(SDP6xClass)];
    
    void evaluate(Context ctx) {
        if (!isSettingUp()) return;

        auto wire = getValue<input_I2C>(ctx);
        auto sf = getValue<input_SF>(ctx);

        Type sensor = new (mem) SDP6xClass(*wire, sf);

        emitValue<output_DEV>(ctx, sensor);

    }
}