return (voltage - base) / (max - base) * full_scale_pressure;
}
+ static double easy_motor_3_adc(double raw) {
+ return raw / 32767.0;
+ }
+
+ static double easy_motor_3_voltage(int sensor) {
+ double supply = 3.3;
+
+ return easy_motor_3_adc(sensor) * supply * 15.6 / 10.0;
+ }
+
static double easy_motor_2_motor_pressure(int sensor, double ground_sensor) {
double supply = 3.3;
double ground_voltage = easy_mini_2_adc(ground_sensor) * supply * 15.6 / 10.0;
return motor_pressure(voltage) - motor_pressure(ground_voltage);
}
+ static double easy_motor_3_motor_pressure(int sensor, double ground_sensor) {
+ double supply = 3.3;
+ double ground_voltage = easy_motor_3_adc(ground_sensor) * supply * 15.6 / 10.0;
+ double voltage = easy_motor_3_adc(sensor) * supply * 15.6 / 10.0;
+
+ return motor_pressure(voltage) - motor_pressure(ground_voltage);
+ }
+
public static double radio_to_frequency(int freq, int setting, int cal, int channel) {
double f;
case AltosLib.AO_LOG_SENSOR:
AltosConfigData config_data = eeprom.config_data();
- listener.set_battery_voltage(AltosConvert.easy_mini_2_voltage(v_batt()));
- double pa = AltosConvert.easy_motor_2_motor_pressure(motor_pres(), cal_data.ground_motor_pressure);
+ listener.set_battery_voltage(AltosConvert.easy_motor_3_voltage(v_batt()));
+ double pa = AltosConvert.easy_motor_3_motor_pressure(motor_pres(), cal_data.ground_motor_pressure);
listener.set_motor_pressure(pa);
int accel_along = accel_along();