Skip to content

Instantly share code, notes, and snippets.

@m25lazi
Created December 19, 2015 17:10
Show Gist options
  • Save m25lazi/de2a898e51daee9562b5 to your computer and use it in GitHub Desktop.
Save m25lazi/de2a898e51daee9562b5 to your computer and use it in GitHub Desktop.
ThingPost client
#include "ThingsPost.h"
// Enter a MAC address for your controller below.
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
ThingsPost thing;
void setup() {
Serial.begin(9600);
thing.enableLogs = true;
if(thing.connect(mac) == ThingsConnectionSuccess){
Serial.println("\n GREAT");
thing.userId = "m25lazi"; //Get this from your dashboard
thing.deviceSecretKey = "uno0025"; //Get this from your dashboard
thing.addPin(12);
thing.uploadInterval = 5; //in minutes
}
else{
Serial.println("\n OMG!!!");
}
}
void loop() {
thing.monitor();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment