Go Down

Topic: Why erasing a value not working (Read 117 times) previous topic - next topic

gharryh

LS,

To show a new value on my ST7735 1.8" display I have to erase a previos value.
This litle piece of code should do that but it doesnt.
Code: [Select]
  int newPercent;
  TFTscreen.setTextSize(3);
  TFTscreen.setCursor((screenWidth / 2), screenHeight / 2);                 // GFX needs setCursor() and print()
  TFTscreen.print("     ");

  rawRFlevel = analogRead(RFlevel);
  newPercent = int((rawRFlevel / 1024.0) * 100.0);

  TFTscreen.setTextSize(3);
  TFTscreen.setCursor((screenWidth / 2), screenHeight / 2);                 // GFX needs setCursor() and print()
  TFTscreen.print(newPercent, 4);
It must be simple so whats wrong here??

Harry

david_prentice

If you want text in transparent mode,  you say:
Code: [Select]

  TFTscreen.setTextColor(ST7735_WHITE);


If you want text in overwrite (rubout) mode,  you set the background colour:
Code: [Select]

  TFTscreen.setTextColor(ST7735_WHITE, ST7735_BLACK);


David.

gharryh

Thanks David,

This problem is solved now on to the next

Go Up