Old Sketch worked in February 2022, no longer works

I'm not sure that this is the correct category to ask for help. If so, please correct me and tell me which category to use.

I have a simple sketch which worked back in February. It doesn't work now.

The sketch uses the Bodmer applied TFT_eSPI Library, with User_Setup_Select, User_Setup, and User_Setups.

I get error messages from TFT_eSPI.cpp, and TFT_eSPI.h related to specifying text background color and text color in the following:

C:\Users\Jerry Renken\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:2726:6: error: prototype for 'void TFT_eSPI::setTextColor(uint16_t, uint16_t)' does not match any in class 'TFT_eSPI'
void TFT_eSPI::setTextColor(uint16_t c, uint16_t b)
In file included from C:\Users\Jerry Renken\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:17:0:
C:\Users\Jerry Renken\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.h:586:12: error: candidates are: void TFT_eSPI::setTextColor(uint16_t, uint16_t, bool)
setTextColor(uint16_t fgcolor, uint16_t bgcolor, bool bgfill = false), // Set character (glyph) foreground and background colour, optional background fill for smooth fonts
C:\Users\Jerry Renken\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:2714:6: error: void TFT_eSPI::setTextColor(uint16_t)

void TFT_eSPI::setTextColor(uint16_t c)

I don't know how to correct this problem related to TFT_eSPI.cpp, and TFT_eSPI.h

From the documentation...

Smooth fonts can now be rendered direct to the TFT with very little flicker for quickly changing values. This is achieved by a line-by-line and block-by-block update of the glyph area without drawing pixels twice. This is a "breaking" change for some sketches because a new true/false parameter is needed to render the background. The default is false if the parameter is missing, Examples:tft.setTextColor(TFT_WHITE, TFT_BLUE, true); spr.setTextColor(TFT_BLUE, TFT_BLACK, true);

Try adding a "false" parameter to the call.

Question is what did change?

  1. Did you update the library?
  2. Did you re-install the IDE and hence re-installed the library?
  3. Did you update the IDE? Newer "rules" can change warnings (that are ignored) to errors (that will not be ignored).

red_car: Thank you for getting back to me with your proposed change to the TFT_eSPI.cpp file in order to solve the setTextColor problem. I have tried making the changes to the TFT_eSPI.cpp file as you suggested in your posting back to me. My implementations of your suggestion did not work.

I enclose in the two Word Documents:

  1. Portions of code from the TFT_eSPI.cpp file referenced by line number in the Error Messages;
    and,
  2. My attempts to implement your solution suggestions to the the TFT_eSPI.cpp

Code Segments from TFT_eSPI_cpp and TFT_eSPI_h.pdf (23.1 KB)

Add_Change Code to solve Set Text Color Problem.pdf (102.3 KB)

Would you please show me how to implement these suggested changes to the TFT_eSPI.cpp fiie?

You also referenced the documentation file related to the solution of this problem. Would you please direct me to the link associated with this documentation?

Best wishes

Please post the sketch you are trying to test this with.

red_car: Sketch plus, the Setup Files . . .

Sketch:
Bodmer_TFT_eSPI_Draw_Text_and_Square_Ref_1.ino (1.8 KB)

TFT_eSPI.cpp (169.4 KB)

TFT_eSPI.h (41.6 KB)

User_Setup_Select.h (2.2 KB)

User_Setup.h (6.1 KB)

Setup109_ILI9341_JR_PD.h (2.3 KB)

This is the set of documents that I use with the attached sketch.

Best wishes

Ok so I tried your test sketch. I did not use any of your other files.

From the IDE I installed the following:

  • Arduino_GFX_Library.h
  • TFT_eSPI.h

Selected ESP 32 Dev board.

The sketch compiles fine... although there are a couple of warnings.

I suggest you try the same approach... uninstall what you already have... or install an old version then install the latest.

red_car: Thank you once more for time working with me. This is clearly a (possibly combined) problem related to the IDE version in use, plus the TFT_eSPI library in use.

Question: When you told me that your version of this sketch compiles, were you able to place text and draw a red box on your ILI9341 Display?

What IDE Release are you using? I am using 1.8.12

What TFT_eSPI Release are you using? I am using TFT_eSPI Release 2.3.70.

Best wishes

red_car:

What IDE Release are you using? I am using 1.8.12

What TFT_eSPI Release are you using? I am using TFT_eSPI Release 2.3.70.

Best wishes

Hey @grenken ... just a note... when responding and you want to tag someone in make sure you put a @ before the user... otherwise they won't be alerted that you have responded (I just happened to stumble across this again).

I'm using 1.8.16 IDE.

and

I don't actually have the required hardware to test... I just tried to compile.

@sterretje : That did it. I changed to TFT_eSPI 2.4.61 and the application worked just fine. I'm not sure how I messed this one up, but I certainly thank you for your help.
Best wishes.

I think the honours go to @red_car. You can click the "solution" button under his/her last post so others who encounter the same problem know that a solution is provided.

@red_car: That did it. I changed to TFT_eSPI 2.4.61 and the application worked just fine. I'm not sure how I messed this one up, but I certainly thank you for your help.
Best wishes.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.