+ int orient() { return int8(5); }
+
+ int accel() { return int16(6); }
+ int pres() { return int32(8); }
+ int temp() { return int16(12); }
+
+ int accel_x() { return int16(14); }
+ int accel_y() { return int16(16); }
+ int accel_z() { return int16(18); }
+
+ int gyro_x() { return int16(20); }
+ int gyro_y() { return int16(22); }
+ int gyro_z() { return int16(24); }
+
+ int mag_x() { return int16(26); }
+ int mag_z() { return int16(28); }
+ int mag_y() { return int16(30); }
+
+ int imu_type;
+
+ private int accel_across(int imu_type) {
+ switch (imu_type) {
+ case AltosIMU.imu_type_telemega_v1_v2:
+ case AltosIMU.imu_type_telemega_v3:
+ case AltosIMU.imu_type_easymega_v1:
+ return accel_x();
+ case AltosIMU.imu_type_easymega_v2:
+ return -accel_y();
+ case AltosIMU.imu_type_telemega_v4:
+ return -accel_y();
+ default:
+ return AltosLib.MISSING;
+ }
+ }