+ //printf("%+3.3f\t%+3.3f\t%+3.3f\r\n", roll, pitch, yaw);
+
+ IRQ_LOCK(flags);
+ ms = global_ms;
+ IRQ_UNLOCK(flags);
+
+ if (fd != NULL) {
+ len = snprintf(buf, sizeof(buf),
+ "%"PRIu32"\t"
+ "gyro %+3.3f\t%+3.3f\t%+3.3f\t\t"
+ "accel %+3.3f\t%+3.3f\t%+3.3f\t\t"
+ "magnet %+3.3f\t%+3.3f\t%+3.3f\r\n",
+ ms,
+ mpu6050_gx, mpu6050_gy, mpu6050_gz,
+ mpu6050_ax, mpu6050_ay, mpu6050_az,
+ mpu6050_mx, mpu6050_my, mpu6050_mz);
+ if (fat_write_file(fd, (unsigned char *)buf, len) != len) {
+ printf_P(PSTR("error writing to file\n"));
+ return -1;
+ }
+ }
+
+ printf("%"PRIu32"\t", ms);
+ printf("gyro %+3.3f\t%+3.3f\t%+3.3f\t\t",
+ mpu6050_gx, mpu6050_gy, mpu6050_gz);
+ printf("accel %+3.3f\t%+3.3f\t%+3.3f\t\t",
+ mpu6050_ax, mpu6050_ay, mpu6050_az);
+ printf("magnet %+3.3f\t%+3.3f\t%+3.3f\r\n",
+ mpu6050_mx, mpu6050_my, mpu6050_mz);
+