Sprintf is not properly inserting float variables into the desired output string. My code is simple:
float thp_data[3];
char output[256];
thp_data[0] = 1.234
thp_data[1] = 1.234
thp_data[2] = 1.234
sprintf(output, "Humidity: %.2f, Pressure: %.2f, Temperature: %.2f\r\n", thp_data[1], thp_data[2], thp_data[0]);
produces the following string in output:
Humidity: %.2f, Pressure: %.2f, Temperature: %.2f
Any ideas on how to fix this?