![](/media/cache/profiles/5f14615696649541a025d3d0f8e0447f.jpg.50x50_q85.jpg)
smple
Dependencies: ESP8266Interface IFTTT mbed
Fork of IFTTT_ESP8266_Example by
Diff: main.cpp
- Revision:
- 4:3994cd534bd5
- Parent:
- 1:15dd4d0a3af0
--- a/main.cpp Tue Jul 14 21:48:01 2015 +0000 +++ b/main.cpp Mon Jul 27 11:43:18 2015 +0000 @@ -2,28 +2,22 @@ #include "ESP8266Interface.h" #include "TCPSocketConnection.h" #include "ifttt.h" +#include "SoftSerialSendOnry.h" -ESP8266Interface wifi(D1,D0,D2,"ssid","passkey",115200); // TX,RX,Reset,SSID,Password,Baud -RawSerial pc(USBTX, USBRX); // tx, rx +ESP8266Interface wifi(dp16,dp15,dp4,"SSID","Password",115200); // TX,RX,Reset,SSID,Password,Baud +SoftSerialSendOnry pc(dp10); // tx int main() { pc.baud(9600); wifi.init(); //Reset wifi.connect(); //Use DHCP - printf("IP Address is %s \n\r", wifi.getIPAddress()); + pc.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 ifttt("EventName","Secret Key", &socket); // EventName, Secret Key, socket to use + + ifttt.addIngredients("value1","value2","value3"); ifttt.trigger(IFTTT_POST); - while(1) { - } }