read-calibration

wayland/bno055-aos/read-calibration

Reads calibration status of the system and three sensors.
read-calibration
@/read-calibration
Reads calibration status of the system and three sensors.
DEV@/bno055-device
A bno055 device.
UPDpulse
read-calibration
SYS
ACC
GYRO
MAG
DONE
DEV
UPD
DONEpulse
Pulses on read of calibration data.
MAGbyte
Magnetometer calibration on a scale of 0-3. 0 = uncalibrated; 3= fully calibrated.
GYRObyte
Gyroscope calibration on a scale of 0-3. 0 = uncalibrated; 3= fully calibrated.
ACCbyte
Accelerometer calibration on a scale of 0-3. 0 = uncalibrated; 3= fully calibrated.
SYSbyte
System calibration on a scale of 0-3. 0 = uncalibrated; 3= fully calibrated.
To use the node in your project you should have the wayland/bno055-aos 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) {

    // The node responds only if there is an input pulse
    if (!isInputDirty<input_UPD>(ctx))
        return;

    // Get a pointer to the `Adafruit_BNO055` class instance
    auto aos = getValue<input_DEV>(ctx);
    uint8_t system, gyro, accel, mag;
    system = gyro = accel = mag = 0;
    aos->getCalibration(&system, &gyro, &accel, &mag);
    emitValue<output_SYS>(ctx, system);
    emitValue<output_GYRO>(ctx, gyro);
    emitValue<output_ACC>(ctx, accel);
    emitValue<output_MAG>(ctx, mag);
    emitValue<output_DONE>(ctx, 1);
}