Mbed to IFTTT

Dependencies:   EthernetInterface IFTTT mbed-rtos mbed

Fork of TCPSocket_Ethernet by TaChing Yu

Files at this revision

API Documentation at this revision

Comitter:
Jeffdhyan
Date:
Sun Sep 11 06:49:25 2016 +0000
Parent:
2:807d696cf266
Commit message:
IFTTT_Mbed

Changed in this revision

IFTTT.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IFTTT.lib	Sun Sep 11 06:49:25 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/mbedAustin/code/IFTTT/#935972c2f628
--- a/main.cpp	Sun Sep 11 06:12:16 2016 +0000
+++ b/main.cpp	Sun Sep 11 06:49:25 2016 +0000
@@ -1,6 +1,7 @@
 #include "mbed.h"
 #include "EthernetInterface.h"
 #include "TCPSocketConnection.h"
+#include "ifttt.h"
 
 EthernetInterface eth;
 RawSerial pc(USBTX, USBRX); // tx, rx
@@ -29,19 +30,34 @@
     }
       
     printf("DONE!\n");
-      
+      // Initialize ifttt object, add up to 3 optional values, trigger event.
+    IFTTT ifttt("hellowordmbed","ExqSjQiwzZINRMFTOgo--", &socket); // EventName, Secret Key, socket to use
+    ifttt.addIngredients("this is awesome","test-ing","data!!!");     // 3 optional Values to send along with trigger.
+    ifttt.trigger();
+
+    // Send data using GET
+    ifttt.addIngredients("Sending","GET","data");
+    ifttt.trigger(IFTTT_GET);
+
+    // Send Data using POST
+    ifttt.addIngredients("Sending","POST","things");
+    ifttt.trigger(IFTTT_POST);
+
+   
+    
     socket.close();
     
     eth.disconnect();
     
-    while(1) {}
+   while(1) {
+    }
 }
 extern "C" void mbed_mac_address(char *mac)
 {
     mac[0] = 0xD4;
     mac[1] = 0x3D;
     mac[2] = 0x7E;
-    mac[3] = 0x3C;
+    mac[3] = 0x2C;
     mac[4] = 0x7E;
     mac[5] = 0x1C;
-};
\ No newline at end of file
+};