Skip to content

Commit a2e6003

Browse files
committed
uupdate code display board
1 parent 9a2f16a commit a2e6003

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

Display/src/main.cpp

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,19 @@ void batt1(float V1) {
168168
voltages_new[0] = V1;
169169
if (voltages_old[0] != voltages_new[0]) {
170170
voltages_old[0] = voltages_new[0];
171-
if (V1 <= 12.8) {
172-
if (!BATT1_EMPTY) {
173-
tft.setTextColor(BLACK);
174-
batt_colours[0] = WHITE;
175-
tft.fillRect(1, 1, WIDTH / 2 - 2, HEIGHT / 3 - 2, batt_colours[0]);
176-
tft.setCursor(8, 25);
177-
tft.setTextSize(5);
178-
tft.println("EMPTY");
179-
BATT1_EMPTY = true;
180-
}
181-
return;
182-
} else if (V1 <= 14.8) {
171+
// if (V1 <= 12.8) {
172+
// if (!BATT1_EMPTY) {
173+
// tft.setTextColor(BLACK);
174+
// batt_colours[0] = WHITE;
175+
// tft.fillRect(1, 1, WIDTH / 2 - 2, HEIGHT / 3 - 2, batt_colours[0]);
176+
// tft.setCursor(8, 25);
177+
// tft.setTextSize(5);
178+
// tft.println("EMPTY");
179+
// BATT1_EMPTY = true;
180+
// }
181+
// return;
182+
// } else
183+
if (V1 <= 14.8) {
183184
batt_colours[0] = RED;
184185
} else if (V1 <= 15.8) {
185186
batt_colours[0] = YELLOW;
@@ -209,18 +210,19 @@ void batt2(float V2) {
209210
voltages_new[1] = V2;
210211
if (voltages_old[1] != voltages_new[1]) {
211212
voltages_old[1] = voltages_new[1];
212-
if (V2 <= 12.8) {
213-
if (!BATT2_EMPTY) {
214-
tft.setTextColor(BLACK);
215-
batt_colours[1] = WHITE;
216-
tft.fillRect(WIDTH / 2 + 1, 1, WIDTH / 2 - 2, HEIGHT / 3 - 2, batt_colours[1]);
217-
tft.setCursor(WIDTH / 2 + 8, 25);
218-
tft.setTextSize(5);
219-
tft.println("EMPTY");
220-
BATT2_EMPTY = true;
221-
}
222-
return;
223-
} else if (V2 <= 14.8) {
213+
// if (V2 <= 12.8) {
214+
// if (!BATT2_EMPTY) {
215+
// tft.setTextColor(BLACK);
216+
// batt_colours[1] = WHITE;
217+
// tft.fillRect(WIDTH / 2 + 1, 1, WIDTH / 2 - 2, HEIGHT / 3 - 2, batt_colours[1]);
218+
// tft.setCursor(WIDTH / 2 + 8, 25);
219+
// tft.setTextSize(5);
220+
// tft.println("EMPTY");
221+
// BATT2_EMPTY = true;
222+
// }
223+
// return;
224+
// } else
225+
if (V2 <= 14.8) {
224226
batt_colours[1] = RED;
225227
} else if (V2 <= 15.8) {
226228
batt_colours[1] = YELLOW;

0 commit comments

Comments
 (0)