I just cannot print a simple IP address with the TFT_eSPI library #2385
Replies: 1 comment 5 replies
-
This is not something I would cover in any TFT_eSPI documentation because it comes down to understanding variable typedef handling. The Arduino print class has probably been extended by the WiFi library so that it understands how to print a "typedef IPAddress" number in the IP address format. The String class has no such understanding, so simply converts the IP address to a number and the TFT library then correctly prints what it is given. You have a couple of options depending on the processor you are using and its associated support library functions. For an ESP32 this should work:
Alternatively the TFT_eSPI library has commented examples which show how to use the print class (which in this case understands how to format the IP address). The above could be replaced by:
Essentially just replace Serial.print with tft.print The TFT_eSPI library is compatible with the basic capability of the Adafruit_GFX library so this may help you get off the ground: |
Beta Was this translation helpful? Give feedback.
-
Hello !
I'm new to the TFT_eSPI library, and because of a serious lack of documentation I struggle to even print a simple IP address...
I'm using a Lilygo T-Display board with an integrated LCD screen and an ESP32-S3 processor.
For example, if I write this simple code (with output to the serial monitor) to connect to my WiFi :
Then on the serial monitor I have this result :
Nothing but normal...
Now I try to adapt this code so it prints on the LCD screen of the Lilygo T-display, and it looks like that :
And this is the result I get on my LCD screen :
IP address, gateway address aud subnet mask look just weird...
I think the solution is very simple, it's surely in the syntax, but as I said, without serious documentation, in regard to the huge list of keywords, I'm lost...
Thank you in advance for any help !
Roland
Beta Was this translation helpful? Give feedback.
All reactions