set-gyro-offsets

gabbapeople/mpu6050/set-gyro-offsets

No description
set-gyro-offsets
@/set-gyro-offsets
DEV@/mpu6050-device
GXoffnumber
Gyroscope offset on X-axis.
GYoffnumber
Gyroscope offset on Y-axis.
GZoffnumber
Gyroscope offset on Z-axis.
DOpulse
set-gyro-offsets
DEV
GXoff
GYoff
GZoff
DO
DEV'
DONE
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->setXGyroOffset(getValue<input_GXoff>(ctx));
        mpu->setYGyroOffset(getValue<input_GYoff>(ctx));
        mpu->setZGyroOffset(getValue<input_GZoff>(ctx));

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