Revision 48741e1f examples/sensorapi/sensorapi.ino

View differences:

examples/sensorapi/sensorapi.ino
94 94
/**************************************************************************/
95 95
void loop(void) 
96 96
{
97
  imu::Vector<3> euler = bno.getEuler();
98

  
97
  // Possible vector values can be:
98
  // - VECTOR_ACCELEROMETER
99
  // - VECTOR_MAGNETOMETER
100
  // - VECTOR_GYROSCOPE
101
  // - VECTOR_EULER
102
  // - VECTOR_LINEARACCEL
103
  // - VECTOR_GRAVITY
104
  imu::Vector<3> euler = bno.getVector(Adafruit_BNO055::VECTOR_EULER);
99 105
  Serial.print("X: ");
100 106
  Serial.println((int)euler.x(), DEC);
101 107
  Serial.print("Y: ");
......
103 109
  Serial.print("Z: ");
104 110
  Serial.println((int)euler.z(), DEC);
105 111
  Serial.println("");
112

  
113
  imu::Quaternion quat = bno.getQuat();
114
  Serial.print("qW: ");
115
  Serial.println((int)quat.w(), DEC);
116
  Serial.print("qX: ");
117
  Serial.println((int)quat.x(), DEC);
118
  Serial.print("qY: ");
119
  Serial.println((int)quat.y(), DEC);
120
  Serial.print("qZ: ");
121
  Serial.println((int)quat.z(), DEC);
122
  Serial.println("");
106 123
  
107 124
  delay(BNO055_SAMPLERATE_DELAY_MS);
108
}
125
}

Also available in: Unified diff