void testF() {
float letterX = 2.0;
float letterY = 7.1;
float letterZ = 5.7;
char tempStrX[10];
char tempStrY[10];
char tempStrZ[10];
dtostrf(letterX, 6, 3, tempStrX);
dtostrf(letterY, 6, 3, tempStrY);
dtostrf(letterZ, 6, 3, tempStrZ);
char buf[36];
sprintf(buf, "The values are %s, %s, and %s.", tempStrX, tempStrY, tempStrZ);
Serial.println(buf);
}
void setup() {
Serial.begin(115200);
// put your setup code here, to run once:
}
void loop() {
testF();
delay(100);
}