Question, i'm trying for to made a script working for the Arduino but i can not find the solution so can some one give me the trick.
I have the next part of the script to made a JSON string:
Code: Select all
str.print("{");
for(int i=0;i<16; i++)
{
if (wiretx.address[i][0] || wiretx.address[i][1])
{
str.print("%22temp_");
for (uint8_t p = 0; p < 2; p++)
{
str.print(wiretx.address[i][p],HEX);
}
str.print("%22");
str.print(':');
str.print("%22");
str.print(wiretx.value[i]/100.0);
str.print("%22");
str.print(",");
str.print("}");
}
}
The only thing i have is that on the and of the script where i can not anymore fill the string i want that he is not closing the string with a , but with the last value.
How can i do that?
I like to hear it.
Regards,