温度をIFTTTにプッシュするサンプルです。
Dependencies: EthernetInterface IFTTT mbed-rtos mbed
Fork of IFTTT_Ethernet_Example by
Revision 2:6b86ba5c0e84, committed 2015-09-14
- Comitter:
- jksoft
- Date:
- Mon Sep 14 14:48:30 2015 +0000
- Parent:
- 1:3010b44f07ff
- Commit message:
- ??
Changed in this revision
--- a/EthernetInterface.lib Mon Jul 13 18:50:53 2015 +0000 +++ b/EthernetInterface.lib Mon Sep 14 14:48:30 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/EthernetInterface/#2fc406e2553f +https://developer.mbed.org/users/jksoft/code/EthernetInterface/#8e983447d2d8
--- a/IFTTT.lib Mon Jul 13 18:50:53 2015 +0000 +++ b/IFTTT.lib Mon Sep 14 14:48:30 2015 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/mbedAustin/code/IFTTT/#c916e13a269a +https://developer.mbed.org/users/jksoft/code/IFTTT/#3e4dacc8923b
--- 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();
--- a/mbed-rtos.lib Mon Jul 13 18:50:53 2015 +0000 +++ b/mbed-rtos.lib Mon Sep 14 14:48:30 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed-rtos/#d3d0e710b443 +http://mbed.org/users/mbed_official/code/mbed-rtos/#21b438192b0f
--- a/mbed.bld Mon Jul 13 18:50:53 2015 +0000 +++ b/mbed.bld Mon Sep 14 14:48:30 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/ba1f97679dad \ No newline at end of file
