I have some code that at times will return foreign unicode characters.
Now when I print the variable indivially, I get the correct values eg
I request a temperature from my DS18B20 which is returned as a float variable
I then request the distance from my HC-SR04 which is returned as a float variable
If I serial print the temperature float variable (code below) I get the temp printed eg 24.31
Serial.println(g_Temp);
If I serial print the distance float variable (code below) I get the distance printed eg 13.22
Serial.println(g_Dist);
However when I combine the two variables into a new variable (code below) for writing to my sd card I "SOMETIMES" get these foreign characters part way through eg
You used the String class, but did not show ALL of your code. There is NO reason to make one String that needs to be unpacked to be printed. The receiver has NO idea how many Serial.print() statements were used. So, quit wasting resources on the String class.
Thank you PaulS, however I am a little confused with your reply. I am obviously doing it all in incorrect way and wasting resources as you say. If you can help me I would be grateful.
I am collecting data from various sensors as float variables and then writing these all to a .CSV file on the SD Card. To write the floats to the csv file I am creating a new string variable to join all the values along with commas as separators.