Hi mates, I tried to figure out myself, for me it's really complicated, I always stop on an error during compiling.
I've tried to create a buffer and then print it butI'm not able to manage strings chars and array of chars. I've tried with String(), strcpy(), .toString(), I surrender.
My goal is to change Serial.printf with lcd.print of the following code
Serial.printf("WebSocket client #%u connected from %s\n", client->id(), client->remoteIP().toString().c_str());
I would also save the string as static, because this cose is inside a routine and I want to keep the string also on the loop, how can I? Thank you
I moved your topic to an appropriate forum category @GiovanniG11.
In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.
Hi, thanks everybody for your kind answers.
sorry pert m I was thinking to have selected exactly what you suggested, maybe something went wrong, I'll be more careful
The board is ESP8266, the library is LiquidCrystal_I2C 1.1.2.
lcd.print("WebSocket client #");
lcd.print(client->id());
lcd.print(" connected from ");
lcd.println(client->remoteIP().toString());
Yes, it works thanks, I would also like to export this alues with a static variable and print them in another part of program, how could I store a string that I don't know how long it is? (IP address)
Can you kindly write a simple example, with variable declarations, thank you!
My goal is to save the output string performed in this routine on a static string/array and use it after in the main loop. I don't know how to manage these values, I always get compiling errors. In particular I don't know:
Ho many chars it will result, how then to define an array
How to convert thise vaues to a text, if they are numbers for example
How to keep this "storage" available for the main loop.
My you kindly write a code for it? Thank you