温度センサLM75BとWi-FiモジュールESP-WROOM-02をmbed LPC1114FN28に繋げて、温度をIFTTTのMaker Channelに出力するプログラム

Dependencies:   LM75B mbed

Revision:
0:53a512d5a7ba
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun May 15 11:47:02 2016 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+#include "ESP8266Interface.h"
+#include "TCPSocketConnection.h"
+#include "ifttt.h"
+#include "LM75B.h"
+
+LM75B sensor(dp5, dp27);
+ESP8266Interface wifi(dp16,dp15,dp4,"SSID","Password",115200); // TX,RX,Reset,SSID,Password,Baud
+
+int main()
+{
+    char value[64];
+    
+    wifi.init(); //Reset
+    wifi.connect(); //Use DHCP
+    
+    TCPSocketConnection socket;
+    
+    // Initialize ifttt object, add up to 3 optional values, trigger event. 
+    IFTTT ifttt("EverntName","Secret Key", &socket); // EventName, Secret Key, socket to use
+    
+    sprintf(value,"%.3f", (float)sensor);
+
+    ifttt.addIngredients(value,"value2","value3");
+    ifttt.trigger(IFTTT_POST);
+}