Quantcast
Channel: ThingSpeak IoT Community - Forum: Arduino
Viewing all articles
Browse latest Browse all 172

mdahlb on Read last value AND time/date from thingspeak

$
0
0

Thanks!

Well, I managed to get the "age" (in seconds) of the most recent entry by adding the following code:

String response = ThingSpeak.readRaw(myChannelNumber, String(String("/fields/") + String(1) + String("/last_data_age")), myReadAPIKey);
Serial.print("Response: ");
Serial.print(response);

 

So, I get the age in seconds although then I have to convert it into a date and time. Hmm, I would be more convinient if I just could get the time/date at once..


Viewing all articles
Browse latest Browse all 172

Trending Articles