set-data-rate

wayland/lis3dh-accelerometer/set-data-rate

Set data rate.
set-data-rate
@/set-data-rate
Set data rate.
DEV@/lis3dh-device
A lis3dh device.
RATEbyte
Data rate. Options: 01h = 1 Hz, 02h = 10 Hz, 03h = 25 Hz, 04h = 50 Hz, 05h= 100 Hz, 06h = 200 Hz, 07h = 400 Hz (default), 00h = powered down, 08h = 1.6 kHz (low power), 09h = 5 kHz (low power).
UPDpulse
Update.
set-data-rate
DONE
DEV
RATE
UPD
DONEpulse
Pulse on completion.
To use the node in your project you should have the wayland/lis3dh-accelerometer 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->setDataRate((lis3dh_dataRate_t)getValue<input_RATE>(ctx));

    emitValue<output_DONE>(ctx, 1);
}