Back to Parent

Code to print event published by IFTTT app
//Code from https://docs.particle.io/guide/tools-and-features/ifttt/#publish-an-event

// This version of code is to check if Twitter tweets from
// my handle (moneyg67) trigger the Photon to print the data
// to the device

int i = 0;

void twitterHandler(const char *event, const char *data)
{
  i++;
  Serial.print(i);
  Serial.print(event);
  Serial.print(", data: ");
  if(data) {
    Serial.println(data);
  } else {
    Serial.println("Null");
  }
}

void setup()
{
  Particle.subscribe("twitter", twitterHandler);
  Serial.begin(9600);
}
Monisha Gopal Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0