![](/media/cache/profiles/5f14615696649541a025d3d0f8e0447f.jpg.50x50_q85.jpg)
温度をIFTTTにプッシュするサンプルです。
Dependencies: EthernetInterface IFTTT mbed-rtos mbed
Fork of IFTTT_Ethernet_Example by
Diff: main.cpp
- Revision:
- 2:6b86ba5c0e84
- Parent:
- 1:3010b44f07ff
--- a/main.cpp Mon Jul 13 18:50:53 2015 +0000 +++ b/main.cpp Mon Sep 14 14:48:30 2015 +0000 @@ -5,6 +5,7 @@ EthernetInterface eth; RawSerial pc(USBTX, USBRX); // tx, rx +AnalogIn ain(p15); int main() { @@ -16,15 +17,18 @@ // 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(); - - // Send data using GET - ifttt.addIngredients("Sending","GET","data"); - ifttt.trigger(IFTTT_GET); + + float tmp; + char msg[10]; + + tmp = (ain - 0.1818)/0.00303; + + sprintf(msg,"%f",tmp); + + printf("msg:%s\r\n",msg); // Send Data using POST - ifttt.addIngredients("Sending","POST","things"); + ifttt.addIngredients(msg,"",""); ifttt.trigger(IFTTT_POST); eth.disconnect();