My App uses JSON to send commands to an Arduino.
One value has to be a number, not a string. But AI2 doesn't convert the string from a textbox to a number. How can I force this?
JSON string received by Arduino (note the quotes around the TANKCAPACITY value). The ID is formatted correctly as a number, but that number is defined in the code and not retrieved from a textbox.
Yep, that does the job. Maybe worthwile to mention this in the documentation. I had to add debug code to Arduino to find out why it was rejecting the command. Fortunately I'm the author of the Arduino code, otherwise I would still be at a loss.
Nice. I already implemented the first method (checking for separators in the string) but the second method (division by 1) is certainly more elegant and more accurate.