read-sensor-status

wayland/bno055-aos/read-sensor-status

Reads status of bno055 sensor.
read-sensor-status
@/read-sensor-status
Reads status of bno055 sensor.
DEV@/bno055-device
A bno055 device.
UPDpulse
Update. Triggers new status reading.
read-sensor-status
STAT
TEST
SERR
DONE
DEV
UPD
DONEpulse
Pulses on completion of read.
SERRbyte
System error: 0 = no error; 1 = peripheral initialization error; 2 = system initialization error; 3 = self test result failed; 4 = register map value out of range; 5 = register map address out of range; 6 = register map write error; 7 = low power mode not available for selected operation mode; 8 = accelerometer power mode not available; 9 = fusion algorithm configuration error; A = sensor configuration error.
TESTbyte
Self-test results: bit 0 = accelerometer self-test; bit 1 = magnetometer self-test; bit 2 = gyroscope self-test; bit 3 = MCU self-test. 0Fh = all good!
STATbyte
System status: 0 = idle; 1 = system error; 2 = initializing peripherals; 3 = system initialization; 4 = executing self-test; 5 = sensor fusion algorithm running ; 6 = system running without fusion algorithm.
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_status, self_test_results, system_error;
    system_status = self_test_results = system_error = 0;
    aos->getSystemStatus(&system_status, &self_test_results, &system_error);
    emitValue<output_STAT>(ctx,system_status);
    emitValue<output_TEST>(ctx,self_test_results);
    emitValue<output_SERR>(ctx,system_error);
    emitValue<output_DONE>(ctx, 1);
}