Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LindaLawton/2aaf1134c1509aa9d55b0c22e7375de0 to your computer and use it in GitHub Desktop.
Save LindaLawton/2aaf1134c1509aa9d55b0c22e7375de0 to your computer and use it in GitHub Desktop.
/*
* Declaring the variables.
*/
char MyIp[16] ;
char AccountId[20] = "UA-XXX-1";
char cid[10] = "123";
void setup() {
Serial.begin(9600);
}
void loop() {
char data[1000] ;
sprintf(data,"{ \"v\": \"1\",\"tid\": \"%s\",\"cid\": \"%s\", \"t\": \"screenview\",\"cd\": \"Kitchen\",\"an\": \"ParticleTesting\",\"uip\": \"%s\" ,\"cm1\": \"%u\"}"
,AccountId
,cid
,WiFi.localIP().toString().c_str()
,1);
Particle.publish("ScreenViewHit", data, PRIVATE);
delay(10000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment