using sprintf on Arduino

This commit is contained in:
tth 2019-01-28 15:00:33 +01:00
parent 15c6cbd8ae
commit 1e2a5e9f31
1 changed files with 6 additions and 7 deletions

View File

@ -36,14 +36,13 @@ void updatevalues(void)
void sendvalues(void) void sendvalues(void)
{ {
int foo; int foo;
char ligne[100];
Serial.print("X"); sprintf(ligne, "X %d %d %d %d",
for (foo=0; foo<NBVAL; foo++) { values[0], values[1],values[2],values[3]);
Serial.print(" ");
Serial.print(values[foo]); Serial.println(ligne);
} }
Serial.print("\n");
}
/* -------------------------------------------------- */ /* -------------------------------------------------- */
void loop() { void loop() {