Junichi Katsu / Mbed 2 deprecated SimpleIoTBoard_sample

Dependencies:   ESP8266Interface IFTTT mbed

Fork of IFTTT_ESP8266_Example by Austin Blackstone

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "ESP8266Interface.h"
00003 #include "TCPSocketConnection.h"
00004 #include "ifttt.h"
00005 #include "SoftSerialSendOnry.h"
00006 
00007 ESP8266Interface wifi(dp16,dp15,dp4,"SSID","Password",115200); // TX,RX,Reset,SSID,Password,Baud
00008 SoftSerialSendOnry pc(dp10); // tx
00009 
00010 int main()
00011 {
00012     pc.baud(9600);
00013     wifi.init(); //Reset
00014     wifi.connect(); //Use DHCP
00015     pc.printf("IP Address is %s \n\r", wifi.getIPAddress());
00016     TCPSocketConnection socket;
00017     
00018     // Initialize ifttt object, add up to 3 optional values, trigger event. 
00019     IFTTT ifttt("EventName","Secret Key", &socket); // EventName, Secret Key, socket to use
00020     
00021     ifttt.addIngredients("value1","value2","value3");
00022     ifttt.trigger(IFTTT_POST);
00023 }