Browse Source

Revert only the voltage display...

master
Englebert 4 years ago
parent
commit
0f9cefb7c5
  1. 20
      OpenFlightTX.ino

20
OpenFlightTX.ino

@ -875,17 +875,7 @@ uint16_t median_get(uint8_t median_type) {
}
}
} else if(median_type == VBAT) {
if(vbat_value > median_tmp[MEDIAN_POS]) {
if(vbat_value - median_tmp[MEDIAN_POS] > RC_DEADBAND) {
return median_tmp[MEDIAN_POS];
} else {
if(median_tmp[MEDIAN_POS] - vbat_value > RC_DEADBAND) {
return median_tmp[MEDIAN_POS];
} else {
return vbat_value;
}
}
}
return median_tmp[MEDIAN_POS];
}
}
@ -1082,8 +1072,8 @@ void battery_management() {
// strcpy(buf, ltoa(vbat_value, buf, 10));
// u8g2_left.drawStr(0, 30, buf);
// float vbat_real_value = vbat_value * .0012142857;
float vbat_real_value = vbat_value * .0012144857;
float vbat_real_value = vbat_value * .0012142857;
// float vbat_real_value = vbat_value * .0012144857;
//strcpy(buf, ltoa(vbat_real_value, buf, 10));
dtostrf(vbat_real_value, 2, 1, buf);
@ -2736,8 +2726,8 @@ void show_battery_level(uint8_t x, uint8_t y) {
u8g2_left.drawLine(x+12, y+2, x+12, y+5);
// Battery level indicator
// int vbat_bar_value = ((vbat_value * .0012142857) - 3.2) * 8;
int vbat_bar_value = ((vbat_value * .0012144857) - 3.2) * 8;
int vbat_bar_value = ((vbat_value * .0012142857) - 3.2) * 8;
// int vbat_bar_value = ((vbat_value * .0012144857) - 3.2) * 8;
// int vbat_bar_value = vbat_value * 10 / 4096;
uint8_t x1 = 0;
for(int i = 0; i < vbat_bar_value; i++) {

Loading…
Cancel
Save