display a new value on TFT screen fails

LS,

I want to show a value on a TFT screen. The following piece of code is inside the loop() section.

But as it is inside loop one would expect that the message blinks but its only shown once.

What could be wrong here??

  if (useTFT) {
    // print the message value
    TFTscreen.text(messageTFT, 0, 100);
    // wait for a moment
    delay(500);
    // erase the text you just wrote
    TFTscreen.stroke(0, 0, 0);
    TFTscreen.text(messageTFT, 0, 100);
  }

Thanks Harry

What's wrong is that you have ignored the forum guide and posted a small code snippet. I suspect I can see the problem there, but I'm not going to risk embarrassment by revealing that in case the code you didn't post proves me wrong.

gharryh:
What could be wrong here??

  1. Incomplete code.
  2. Refresh rate of the display.
  3. Text is rewritten to the display right after it is erased.

Danois90:

  1. Incomplete code.
  2. Refresh rate of the display.
  3. Text is rewritten to the display right after it is erased.
  • Code is correct, if I remove the erase the line is overwritten with new data
  • How can i control this?
  • how long should one wait after a erase?

Harry

Posting partial code makes it hard to help. What the posted code does is:

  1. Write message to TFT
  2. Delay ½ second
  3. Erase TFT
  4. Write message to TFT

If your goal is to make the text blink, I suggest your delay is ill positioned.

Danois90:
Posting partial code makes it hard to help. What the posted code does is:

  1. Write message to TFT
  2. Delay ½ second
  3. Erase TFT
  4. Write message to TFT

If your goal is to make the text blink, I suggest your delay is ill positioned.

Your correct and it works now