I've been using sprinft in my code to convert strings and numbers into strings.
xxxstr is an char array of 19 characters
Numbers are all 32bit unsigned int.
sprintf(Speedstr, "Speed #4.4u km/h ",Speed); sprintf(Diststr, "Dist #4.4u km ",Distance); sprintf(PowerInstr, "Power in #4.4u kW ",Powerin); sprintf(PowerOutstr,"Power Out #4.4u kW ",Powerout);
Then I'm displaying them on a 20x 4 LCD.
However when I try and send the contents of Speedstr over usart, the Speedstr file is coming out with the Distance and Powerin in the same file. Strangely enough, not Powerout. Is there a better way to write/buffer integers to strings so that they don't all end up in the same file?
I have 4 menus and this is going to cause havoc otherwise.