Good morning everyone.
I have a small problem that I'm hoping someone can help me resolve.
I'm collecting some weather data from Accuweather and one of the elements I'm collecting is a text field. This morning, the text field contained this -
A snow squall, up to 1"
Back in the day, ArduinoJson lib created this field for it -
const char* DailyForecasts_1_Day_ShortPhrase
When I saw the missing data and saw on the Accuweather site what had been sent, I knew what the problem was. The ".
This is my first C++ program and I went from Blink to 1200 lines of bad decisions. It seems like every line I've written took two days to debug.
I've tried this -
String t_temp = weather_forecast.DailyForecasts_Day_ShortPhrase;
t_temp.trim();
t_temp.replace("\"", "\\""");
Serial1.print("page4.t" + in + ".txt=\""); Serial1.printf("%s", t_temp); Serial1.print(F("\"")); strEnd();
And -
t_temp.replace("\"", "\"");
And -
t_temp.replace("\"", """");
Everything I've tried results in a line of garbage characters on the Nextion.
The Nextion print statement that I had been using before my testing was this-
Serial1.print("page4.t" + in + ".txt=\""); Serial1.printf("%s", weather_forecast.DailyForecasts_Day_ShortPhrase); Serial1.print(F("\"")); strEnd();
It works fine, except for not displaying anything if there's a " in the data.
Any suggestions would be greatly appreciated.
Between this project, the Stay-At-Home orders and my wife ragging on me for hoarding toilet paper, I'm about to completely lose it.
Thanks all.