init

wayland/bno055-aos/init

Initializes bno055 device.
init
@/init
Initializes bno055 device.
DEV@/bno055-device
A bno055 device.
INITpulse
Trigger for initialization. Default is to initialize on boot.
init
OK
ERR
DEV
INIT
ERRpulse
Pulse if initialization failed.
OKpulse
Pulse if initialization successful.
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_INIT>(ctx))
        return;

    // Get a pointer to the `Adafruit_BNO055` class instance
    auto aos = getValue<input_DEV>(ctx);

    // Attempt to initialize aos module; if attempt fails emit pulse from error port
    if (!aos->begin()) {
        emitValue<output_ERR>(ctx, 1);
        return;
    }

    // Pulse that module initialized successfully
    emitValue<output_OK>(ctx, 1);
}