IFTTT triggering example

Dependencies:   EthernetInterface IFTTT mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "EthernetInterface.h"
00003 #include "TCPSocketConnection.h"
00004 #include "ifttt.h"
00005 
00006 EthernetInterface eth;
00007 Serial pc(USBTX, USBRX); // tx, rx
00008 
00009 int main()
00010 {
00011     pc.baud(9600);
00012     eth.init(); //Use DHCP
00013     eth.connect();
00014     TCPSocketConnection socket;
00015 
00016     // Initialize ifttt object, add up to 3 optional values, trigger event.
00017     IFTTT ifttt("EventName","SecurityKey", &socket); // EventName, Secret Key, socket to use
00018 
00019     // Send Data using POST
00020     ifttt.addIngredients("hogehoge"); //Value1
00021     ifttt.trigger(IFTTT_POST);
00022 }