altoslib: Support TeleBT v3.0 battery voltage conversion
[fw/altos] / altoslib / AltosConvert.java
index 5750afad42338f5d24819eb28e7b4b4b7af11342..3e0f0e1ac99170caa03b1a626575fd936bae1873 100644 (file)
@@ -230,6 +230,12 @@ public class AltosConvert {
                return sensor / 32767.0 * supply * (5.6 + 10.0) / 10.0;
        }
 
+       static double tele_bt_3_battery(int raw) {
+               if (raw == AltosLib.MISSING)
+                       return AltosLib.MISSING;
+               return 3.3 * mega_adc(raw) * (5.1 + 10.0) / 10.0;
+       }
+
        static double easy_mini_voltage(int sensor, int serial) {
                double  supply = 3.3;
                double  diode_offset = 0.0;