+ public int gyro_x = AltosLib.MISSING;
+ public int gyro_y = AltosLib.MISSING;
+ public int gyro_z = AltosLib.MISSING;
+
+ public int mag_x = AltosLib.MISSING;
+ public int mag_y = AltosLib.MISSING;
+ public int mag_z = AltosLib.MISSING;
+
+ public static final double counts_per_g = 2048.0;
+
+ public static double convert_accel(double counts) {
+ return counts / counts_per_g * AltosConvert.gravity;
+ }
+
+ /* In radians */
+ public static final double GYRO_FULLSCALE_DEGREES = 2000.0;
+ public static final double GYRO_COUNTS = 32767.0;
+
+ public static double gyro_degrees_per_second(double counts, double cal) {
+ return (counts - cal) * GYRO_FULLSCALE_DEGREES / GYRO_COUNTS;
+ }