I am having a hard time compiling the TFT_eSPI library for my application. I can't even compile the simplest code:
The compiler errors out that TFT_eSPI has no member named "init".
Here are some particulars:
- I am using the latest Particle Bench in VS.
- I create a fresh project with the "Particle: Create Project" function
- I load the TFT_eSPI library with the "Particle: Install Library" function.
- I configure the project for the device - a Photon (gen1) running 2.3.1
- I tweak the User_Setup.h file. The changes are minor
- comment out #define ESP32_PARALLEL since I am using SPI
- leave "#define ILI9163_DRIVER" alone since this is the device I want.
- comment out the "ModeMCU" defines for pins
- configure the pins to reflect my SPI setup as shown here
The IDE warns that it detects an include error in "#include "TFT_eSPI.h"". It says it cannot open source file "pgmspace.h"
So, I look around for "pgmspace.h" and replace with "avr/pgmspace.h". This resolves the include errors.
- I compile with "Particle: Cloud Compile" and get the error below.
I spend a bit of time trying to diagnose the issue, but can't seem to crack this nut. Does anyone have some advice? I haven't been programming for a couple years, and got back into it a few days ago for a project that I want to tackle.
Have you looked at the community library reference?
tFT_eSPI.begin(); //not init?
Also the comment somewhere says (only tested with ILI9341) and you are using ILI9163 - maybe it does not work?
You could try contacting the author?
Thank you for for the advice. After reading it, I realized that in the process of trying to include all the important info, I mistyped. In fact, I am using ILI9341 driver:
WRT the community library reference, can you explain? As you might guess, I have only recently joined. I tried searching for eSPI references but didn't find anything.
WRT using TFT_eSPI.begin(); Yes. I tried that and it does compile. However, if I use another method like here, I end up back nearly in the same place:
What stumps me is that the autocomplete works and discovers all of the methods and definitions.
I had a bit of time and some interest to try using TFT_eSPI instead of Adafruit_GFX.
Not sure how this is meant to work as a library because the files are all there but are not being found, this is because the copy in the lib/TFT_eSPI/src folder is a sort of dummy of TFT_eSPI.h. If you copy the version of TFT_eSPI.h and .cpp in the lib folder into the /src folder then all those problems go away.
Unfortunately that's not the end of the problems - because there are Fonts and Drivers all in folders on the same level as /src aren't being found even though <>'s are being used on the #include and the folder name e.g. #include <Fonts/glcdfont.c>
I would take advice from others about why this is - and the best way to fix it.
I am not sure that this has been tested with a Photon or Photon2 as I am trying with.
Thanks for the clue. I will try and figure this out and will update the post when I have made some progress.
I have managed to get this library to build but frankly it was originally written for ESP8266 and then modified for ESP32 and later for RPI2040. There were many (>100) type mismatches that were throwing warnings and errors with the PROGMEM use and access. At the heart of this library it uses Adafruit_GFX so really you could just try the Adafruit_GFX_RK library that will work 'out of the box'. There are some improvements around fonts and writing text to screen instead of using .print(). Depends what your needs are.
I had been using the Adafruit GFX library and it is perfectly adequate. However, I was intrigued by the examples and the potential to get some nice graphics without too much trouble. I did spend some time on this last week, but realized this was required more time than I wanted to invest in this increment.
In the meantime, I started testing a temperature barometer sensor (BMP390), but soon realized that there is potentially some issue with the Adafruit_BMP3XX library working correctly. Then, to further arrest progress, I am now having another new issue with the Photon 2 not updating its firmware - both of which appear to have existing threads.
Anyhow WRT to the original topic, once I have a baseline MVP I might circle back and look at harvesting some bits and pieces of the library for my application.
Good luck with fixing the issues you have listed.
There are a few interesting examples I have tried:
- Matrix screen (vertical screen scrolling - this is a hardware feature with ILI9341 in portrait orientation).
- Star field - a bit jerky when SPI running at 25MHz
- Bitmap from Flash
Mostly the rest are font related - I might look at whether there are any speed improvements for custom font writing.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.