Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface IFTTT mbed-rtos mbed
Fork of IFTTT_Ethernet_Example by
main.cpp
00001 #include "mbed.h" 00002 #include "EthernetInterface.h" 00003 #include "TCPSocketConnection.h" 00004 #include "ifttt.h" 00005 00006 EthernetInterface eth; 00007 RawSerial pc(USBTX, USBRX); // tx, rx 00008 00009 int main() 00010 { 00011 pc.baud(9600); 00012 EthernetInterface eth; 00013 eth.connect(); 00014 wait(0.5); 00015 printf("IP Address is %s \n\r", eth.getIPAddress()); 00016 TCPSocketConnection socket; 00017 00018 // Initialize ifttt object, add up to 3 optional values, trigger event. 00019 IFTTT ifttt("OWJMAN","bkJhw8soKcjx28zrqAgeW2", &socket); // EventName, Secret Key, socket to use 00020 ifttt.addIngredients("this is awesome","test-ing","data!!!"); // 3 optional Values to send along with trigger. 00021 ifttt.trigger(); 00022 00023 // Send data using GET 00024 ifttt.addIngredients("Sending","GET","data"); 00025 ifttt.trigger(IFTTT_GET); 00026 00027 // Send Data using POST 00028 ifttt.addIngredients("Sending","POST","things"); 00029 ifttt.trigger(IFTTT_POST); 00030 00031 eth.disconnect(); 00032 }
Generated on Thu Aug 18 2022 12:44:38 by
1.7.2
