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: ESP8266Interface IFTTT mbed
Fork of IFTTT_Ethernet_Example by
main.cpp
- Committer:
- mbedAustin
- Date:
- 2015-07-14
- Revision:
- 2:7677729fe02d
- Parent:
- 1:15dd4d0a3af0
File content as of revision 2:7677729fe02d:
#include "mbed.h"
#include "ESP8266Interface.h"
#include "TCPSocketConnection.h"
#include "ifttt.h"
ESP8266Interface wifi(D1,D0,D2,"ssid","passkey",115200); // TX,RX,Reset,SSID,Password,Baud
RawSerial pc(USBTX, USBRX); // tx, rx
int main()
{
pc.baud(9600);
wifi.init(); //Reset
wifi.connect(); //Use DHCP
printf("IP Address is %s \n\r", wifi.getIPAddress());
TCPSocketConnection socket;
// Initialize ifttt object, add up to 3 optional values, trigger event.
IFTTT ifttt("YourEventName","ChangeToYourSecretKey", &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();
ifttt.addIngredients("Sending","GET","data");
ifttt.trigger(IFTTT_GET);
ifttt.addIngredients("Sending","POST","things");
ifttt.trigger(IFTTT_POST);
while(1) {
}
}

If This Then That (IFTTT)