set-accel-offsets

gabbapeople/mpu6050/set-accel-offsets

No description
set-accel-offsets
@/set-accel-offsets
DEV@/mpu6050-device
AXoffnumber
Accelerometer offset on X-axis.
AYoffnumber
Accelerometer offset on Y-axis.
AZoffnumber
Accelerometer offset on Z-axis.
DOpulse
set-accel-offsets
DEV'
DONE
DEV
AXoff
AYoff
AZoff
DO
DONEpulse
DEV'@/mpu6050-device
To use the node in your project you should have the gabbapeople/mpu6050 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

node {
    void evaluate(Context ctx) {
        auto mpu = getValue<input_DEV>(ctx);

        if (isSettingUp())
            emitValue<output_DEVU0027>(ctx, mpu);

        if (!isInputDirty<input_DO>(ctx))
            return;

        mpu->setXAccelOffset(getValue<input_AXoff>(ctx));
        mpu->setYAccelOffset(getValue<input_AYoff>(ctx));
        mpu->setZAccelOffset(getValue<input_AZoff>(ctx));

        emitValue<output_DONE>(ctx, 1);
    }
}