X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosEepromFireTwo.java;h=16019c8c280320c10cd86c84b7dada7fd71efa9a;hp=14a026a9b5d83749a3547fa1f327cd75b1890beb;hb=c17b78e60c340c8a3e3d6f9b875667c66216647a;hpb=d97c4d2f6de2981c2efd7bfbc9f5f9649987b854 diff --git a/altoslib/AltosEepromFireTwo.java b/altoslib/AltosEepromFireTwo.java index 14a026a9..16019c8c 100644 --- a/altoslib/AltosEepromFireTwo.java +++ b/altoslib/AltosEepromFireTwo.java @@ -49,13 +49,11 @@ public class AltosEepromFireTwo extends AltosEeprom { private static final double r_below = 10000.0; private static final double v_adc = 3.3; - private static double - firetwo_adc(int raw) { + private static double firetwo_adc(int raw) { return raw / 4095.0; } - private static double - adc_to_pa(int adc) { + public static double adc_to_pa(int adc) { /* raw adc to processor voltage, then back through the * voltage divider to the sensor voltage @@ -71,6 +69,13 @@ public class AltosEepromFireTwo extends AltosEeprom { return AltosConvert.psi_to_pa(psi); } + public static double adc_to_n(int adc) { + double v = firetwo_adc(adc); + + /* this is a total guess */ + return AltosConvert.lb_to_n(v * 298 * 9.807); + } + public void update_state(AltosState state) { super.update_state(state);