I've been looking around for an example of how to get the "created" value from a feed on arduino, like the one you see in the io.adafruit.com feed interface. I have a handleMessage function that does the following:
Code: Select all
void handleMessage(AdafruitIO_Data *data) {
Serial.print("received <- ");
Serial.println(data->value());
digitalWrite(5, HIGH); // sets the digital pin 5 on
delay(1000); // waits for a second
digitalWrite(5, LOW); // sets the digital pin 5 off
delay(1000);
}
Another way I could do it is only grab messages in the feed within a minute of the current time (by a filter of some sort?) but I couldn't figure out how to do that either. I've seen the REST examples but I'm on an arduino using the AdafruitIO_WiFi lib so I'm having trouble how that is done. My feed setup looks like this:
Code: Select all
// set up the feed
AdafruitIO_Feed *myfeed = io.feed("myfeed");
Thanks for your help and any guidance.
-Matt