Created
December 19, 2015 17:10
-
-
Save m25lazi/de2a898e51daee9562b5 to your computer and use it in GitHub Desktop.
ThingPost client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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