Fill Display Lines to Avoid Artifacts

This commit is contained in:
seiichiro 2021-06-20 18:42:26 +02:00
parent 285ef0bb93
commit d1195efb82

View file

@ -84,6 +84,12 @@ void loraKeySetup(uint8_t keyset) {
lora.setKeys(NwkSkey_2, AppSkey_2, DevAddr_2);
}
void fillLine() {
for (uint8_t i = oled.tx; i<15; i++)
oled.print(" ");
oled.println("");
}
// Button Handler Function
void handler(Button2& btn) {
switch (btn.getClickType()) {
@ -198,37 +204,49 @@ void updateDisplay() {
oldFix = hasFix;
}
oled.print("HDOP: ");
oled.println(buffer[0]);
oled.print(buffer[0]);
fillLine();
oled.print("Sats: ");
oled.print(buffer[1]);
oled.print("/");
oled.println(buffer[2]);
oled.print(buffer[2]);
fillLine();
oled.print("Int: ");
oled.println(interval);
oled.print(interval);
fillLine();
oled.print("Packet: ");
oled.println(packets);
oled.print(packets);
fillLine();
oled.print("Alt: ");
oled.println(buffer[3]);
oled.print(buffer[3]);
fillLine();
oled.print("Speed: ");
oled.println(buffer[4]);
oled.print(buffer[4]);
fillLine();
oled.print("Bat: ");
oled.println((float)readSupplyVoltage()/1000);
oled.print((float)readSupplyVoltage()/1000);
fillLine();
} else {
if (hasFix != oldFix){
oled.clear();
oldFix = hasFix;
}
oled.println("NO GPS FIX");
oled.print("NO GPS FIX");
fillLine();
oled.print("Sats: ");
oled.print(buffer[1]);
oled.print("/");
oled.println(buffer[2]);
oled.print(buffer[2]);
fillLine();
oled.print("Int: ");
oled.println(interval);
oled.print(interval);
fillLine();
oled.print("Packet: ");
oled.println(packets);
oled.print(packets);
fillLine();
oled.print("Bat: ");
oled.println((float)readSupplyVoltage()/1000);
oled.print((float)readSupplyVoltage()/1000);
fillLine();
}
oled.print(statusmsg);
oled.println(" ");