Arduino Function: NaxisMotion.setOperationMode

Description

This function is used to set the operation mode of the BNO055

Syntax

void setOperationMode(byte operationMode)

Parameters

byte operationMode:

  • OPERATION_MODE_CONFIG 0x00 Configuration Mode (Transient Mode)
  • OPERATION_MODE_ACCONLY 0x01 Accelerometer only
  • OPERATION_MODE_MAGONLY 0x02 Magnetometer only
  • OPERATION_MODE_GYRONLY 0x03 Gyroscope only
  • OPERATION_MODE_ACCMAG 0x04 Accelerometer and Magnetometer only
  • OPERATION_MODE_ACCGYRO 0x05 Accelerometer and Gyroscope only
  • OPERATION_MODE_MAGGYRO 0x06 Magnetometer and Gyroscope only
  • OPERATION_MODE_AMG 0x07 Accelerometer, Magnetometer, Gyroscope (without fusion)
  • OPERATION_MODE_IMUPLUS 0x08 Inertial Measurement Unit (Accelerometer and Gyroscope Sensor Fusion Mode)
  • OPERATION_MODE_COMPASS 0x09 Tilt Compensated Compass (Accelerometer and Magnetometer Sensor Fusion Mode)
  • OPERATION_MODE_M4G 0x0A Magnetometer and Accelerometer Sensor Fusion Mode
  • OPERATION_MODE_NDOF_FMC_OFF 0x0B 9 Degrees of Freedom Sensor Fusion with Fast Magnetometer Calibration Off
  • OPERATION_MODE_NDOF 0x0C 9 Degrees of Freedom Sensor Fusion

Examples

//Contains the bridge code between the API and the Arduino Environment
#include "NAxisMotion.h"
#include <Wire.h>

//Object that for the sensor
NAxisMotion mySensor;

void setup() { //This code is executed once
//Initialize I2C communication to the let the library communicate with the sensor.
I2C.begin();

//The I2C Address can be changed here inside this function in the library
mySensor.initSensor();

//Can be configured to other operation modes as desired
mySensor.setOperationMode(OPERATION_MODE_NDOF);
}

void loop() { //This code is looped forever
// blank
}


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc