Example #1
0
void getMotionData(Datum *datum) {
  
  acc.getAcceleration(&datum->acc.x, &datum->acc.y, &datum->acc.z);
  mag.getHeading(&datum->mag.x, &datum->mag.y, &datum->mag.z);
  gyr.getRotation(&datum->gyr.x, &datum->gyr.y, &datum->gyr.z);
  
}
Example #2
0
void ExtendoHand::getAcceleration(Vector3D &a) {
    if (nineAxis) {
        int16_t ax, ay, az;
        accel.getAcceleration(&ax, &ay, &az);

        // approximate g values, per calibration with a specific sensor
        a.set(
            ax / 230.0 - 0.05,
            ay / 230.0,
            az / 230.0);
    } else {
#ifdef THREE_AXIS
        a.set(
            motionSensor.accelX(),
            motionSensor.accelY(),
            motionSensor.accelZ());
#endif // THREE_AXIS
    }
}