TFT_eSPI printToSprite issue

I've got a crazy problem with printToSprite, it will not display the number 1 by itself. Any other number no problem, 10, 100, 1000, 01, single letters... just not the number 1. Totally crazy, I don't know what to do. Doesn't matter where the cursor is on the screen, what color it is, nothing. It appears to make a sprite of the correct size, shape, and location; it's just empty.

You might want to look at this How to get the best out of this forum before you proceed any further.
We only know what you tell us, and without knowing what you have, we don't stand a chance.

Now what display are you using?
What Arduino do you have?
What code are you using? Please post it properly according to the link above.
How is it wired? Please post a schematic.

Display is a ST7789, board is an ESP32-WROOM-32D, Library is TFT_eSPI, the display is wired directly to the board to its SPI. The program is way too large to post here, it works pretty much 99.9% the way I would expect it to. When calling printToSprite("1") I get a blank sprite, change it to anything else and it shows as expected. I'll try and get a picture to show what is happening.


It's a bit tough to make out but you can see 0-7 are all there just no 1.

can you implement a small test program which shows the problem?

There is a simple project here. Try that on your display and see if this works as written.

If it does then we can look at changing it into code you want your display to look like.

void setup(void) {
  Serial.begin(250000);
  tft.begin();
  tft.setRotation(1);
  spr.setColorDepth(16); // 16-bit colour needed to show anti-aliased fonts
  pinMode(TFT_BL, OUTPUT);
  analogWrite(TFT_BL, 255);
  tft.fillScreen(TFT_BLACK);
}
void loop() {
  for(int i = 0; i <= 10; i++) {
  tft.setTextDatum(TL_DATUM); // Top Centre datum
  spr.loadFont(AA_FONT_16_14); // Must load the font first into the sprite class  
  spr.setTextColor(TFT_BLACK, TFT_SKYBLUE); // Set the sprite font colour and the background colour
  tft.setCursor(10, 10);
  spr.printToSprite((String) (i));    // Prints to tft cursor position, tft cursor NOT moved
  delay(500);
  }
}

Even this basic loop prints a blank sprite for the number one. I don't get it, i'm going to open an issue on github, this has to be a bug.

If you want to post your complete code , some further assistance maybe provided ! :roll_eyes:

All this should be in the setup function not the loop function. Also there are no library #include for any of the libraries you need to use.

Have you soldered the pins on the ST7789 TFT display and not just pushed them in?

yeah ,but :upside_down_face: the bug is NOT in the git library !

Hi exiled350,
try the following:

spr.drawNumber (i, 10, 10, 2);

andthen spr.pushSprite (x,y coordinates in teh sprite ,

success, photoncatcher