summaryrefslogtreecommitdiff
path: root/ao-tools/altosui/AltosConvert.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-08-05 13:50:18 -0400
committerKeith Packard <keithp@keithp.com>2010-08-05 13:50:18 -0400
commitd8bf05f7ad55964c9bce0551e58f4ef6c9f721ad (patch)
treefb6683cd1b832be828a82497b57f42e8db082b5d /ao-tools/altosui/AltosConvert.java
parent85a670b5a904d6750d0f179ae307baeb8fc7cbd2 (diff)
altosui: Split flight record out of telemetry class
This will permit either telemetry or eeprom data to be used to construct the sequence of flight events for reply or data generation. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosConvert.java')
-rw-r--r--ao-tools/altosui/AltosConvert.java57
1 files changed, 2 insertions, 55 deletions
diff --git a/ao-tools/altosui/AltosConvert.java b/ao-tools/altosui/AltosConvert.java
index 3be0716c..8cc1df27 100644
--- a/ao-tools/altosui/AltosConvert.java
+++ b/ao-tools/altosui/AltosConvert.java
@@ -62,7 +62,7 @@ public class AltosConvert {
* altitudes are measured with respect to the mean sea level
*/
static double
- cc_altitude_to_pressure(double altitude)
+ altitude_to_pressure(double altitude)
{
double base_temperature = LAYER0_BASE_TEMPERATURE;
double base_pressure = LAYER0_BASE_PRESSURE;
@@ -115,7 +115,7 @@ public class AltosConvert {
/* outputs the altitude associated with the given pressure. the altitude
returned is measured with respect to the mean sea level */
static double
- cc_pressure_to_altitude(double pressure)
+ pressure_to_altitude(double pressure)
{
double next_base_temperature = LAYER0_BASE_TEMPERATURE;
@@ -178,59 +178,6 @@ public class AltosConvert {
return altitude;
}
- /*
- * Values for our MP3H6115A pressure sensor
- *
- * From the data sheet:
- *
- * Pressure range: 15-115 kPa
- * Voltage at 115kPa: 2.82
- * Output scale: 27mV/kPa
- *
- *
- * 27 mV/kPa * 2047 / 3300 counts/mV = 16.75 counts/kPa
- * 2.82V * 2047 / 3.3 counts/V = 1749 counts/115 kPa
- */
-
- static final double counts_per_kPa = 27 * 2047 / 3300;
- static final double counts_at_101_3kPa = 1674.0;
-
- static double
- cc_barometer_to_pressure(double count)
- {
- return ((count / 16.0) / 2047.0 + 0.095) / 0.009 * 1000.0;
- }
-
- static double
- cc_barometer_to_altitude(double baro)
- {
- double Pa = cc_barometer_to_pressure(baro);
- return cc_pressure_to_altitude(Pa);
- }
-
- static final double count_per_mss = 27.0;
-
- static double
- cc_accelerometer_to_acceleration(double accel, double ground_accel)
- {
- return (ground_accel - accel) / count_per_mss;
- }
-
- /* Value for the CC1111 built-in temperature sensor
- * Output voltage at 0°C = 0.755V
- * Coefficient = 0.00247V/°C
- * Reference voltage = 1.25V
- *
- * temp = ((value / 32767) * 1.25 - 0.755) / 0.00247
- * = (value - 19791.268) / 32768 * 1.25 / 0.00247
- */
-
- static double
- cc_thermometer_to_temperature(double thermo)
- {
- return (thermo - 19791.268) / 32728.0 * 1.25 / 0.00247;
- }
-
static double
cc_battery_to_voltage(double battery)
{