Hello all, I have been working on this for hours without any luck and hope to find some guidance here. I am rewriting a sketch I made last year for a different processor and larger display. I switched to u8g2 for the new display (old code is left for ease of update) but using spaces is not overwriting when glyphs/data updates. What am I doing wrong?
case 0x76A77416:
if (v >= 5){
pausev = v;
v = 0;
delay(500);
//lcd.setCursor(55, 0);
//lcd.setFontSize(FONT_SIZE_MEDIUM);
//lcd.setCursor(55, 0);
//lcd.println(" ");
//lcd.setCursor(55, 0);
//lcd.println("P CENTER");
u8g2.setFont(u8g2_font_IPAandRUSLCD_tf);
u8g2.setFontMode(0);
u8g2.setCursor(35, 20);
u8g2.print(" ");
u8g2.setCursor(35, 20);
u8g2.print("PAUSED CENTER");
u8g2.sendBuffer();
}
else if (v < 5){
v = pausev;
delay(500);
//lcd.setCursor(55, 0);
//lcd.setFontSize(FONT_SIZE_MEDIUM);
//lcd.setCursor(55, 0);
//lcd.println(" ");
//lcd.setCursor(70, 0);
//lcd.println(hz, 3);
u8g2.setFont(u8g2_font_IPAandRUSLCD_tf);
u8g2.setFontMode(0);
u8g2.setCursor(35, 20);
u8g2.print(" ");
u8g2.setCursor(85, 20);
u8g2.print(hz, 3);
u8g2.sendBuffer();
goto SHOW;
Yes, there are other triggers that cause this and other lines to update, occasionally with a longer response that in this case begins at 35, 20 - so this is to assure that the info/data is cleared.
I'm not sure I understand your question correctly, but it seems to me that you are trying to 'delete' a text and then write another in its place. Try deleting it by saving the old text in the same place but with the same color as the background color.
Hi UKHeliBob, Thanks for trying to lend your assistance.
I should have put more thought into my description. I am trying to use spaces to delete/overwrite sections of info on my display prior to updating the info. In the past, I have been able to simply write spaces to do so but it seems U8g2 handles this differently. The info being deleted and updated occasionally begins at an earlier point on the display depending on the length of data, hence the (35, 20) vs (85, 20).
It's not solved yet, I am working on it again now.
Thanks for the suggestion, you guessed correctly. I think that would work but it seems like there must be a simpler method? I have 6 lines of information that update very frequently using a switch/case and I am not sure I can pull the fields into a different case easily prior to the new info being created - so I think in order to print the old info as the background I would need to create a variable to store each prior update line to be used in the next switch/case update. I don't know if that made any sense either?
Last time I tried to do PC monitoring with Arduino and AIDA64. I use the Ucglib library and SPI displays when working with Nano and WeMos D1 mini. Every 2 seconds AIDA64 sends the values of about 20 computer parameters and the microcontroller displays them on the SPI display. I have applied several ways to speed up the writing process. Using SPI.setClockDivider (SPI_CLOCK_DIV2) I set the maximum SPI speed for working with the display. I save the previous value of each parameter and only if the new value is different the old one is deleted as explained before and then the new value is displayed. This is done for each parameter and the result is quite good in my opinion, with only a slight flicker of the values that change. You can see the result in the video.
Thanks for this flashko, this is a great method to handle the clunky update problem, I will give it a shot - I would love to have a faster update response.