set-range

wayland/lis3dh-accelerometer-spi/set-range

Set range.
set-range
@/set-range
Set range.
DEV@/lis3dh-device-spi
A lis3dh device.
RANGEbyte
Range. Options: 00h = +/- 2g (default), 01h = +/- 4g, 02h = +/- 8g, 03h = +/- 16g.
UPDpulse
Update.
set-range
DEV
RANGE
UPD
DONE
DONEpulse
Pulse on completion.
To use the node in your project you should have the wayland/lis3dh-accelerometer-spi 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) {
    
    if (!isInputDirty<input_UPD>(ctx))
        return;

    // Get a pointer to the `Adafruit_LIS3DH` class instance
    auto sensor = getValue<input_DEV>(ctx);

    sensor->setRange((lis3dh_range_t)getValue<input_RANGE>(ctx));

    emitValue<output_DONE>(ctx, 1);
}