Quantcast
Channel: ThingSpeak IoT Community - All Forums
Viewing all articles
Browse latest Browse all 1833

rw950431 on Reading back data from Thingspeak

$
0
0

Unfortunately, as you have found, the Arduino web client lacks many of the sophisticated features of more advanced programming environments so you are left to deal with the raw strings by yourself.

 

If you are certain that the line you want is the only one that starts with a number then the procedure isnt too hard.

 

 

while(Client.available()){
String line = Client.readStringUntil('
');

  if ( line.charAt(0)>='0' and line.charAt(0)<='9') {
    Serial.println(line);

  };

};

See https://www.arduino.cc/en/Reference/StringObject particularly https://www.arduino.cc/en/Tutorial/StringCharacters

You may also wish to convert your string to a useable number instead - see https://www.arduino.cc/en/Reference/StringToInt


Viewing all articles
Browse latest Browse all 1833

Trending Articles