Send Yo from mbed! http://www.justyo.co/

Dependencies:   EthernetInterface HTTPClient YoApi mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
hsgw
Date:
Wed Jun 25 13:14:51 2014 +0000
Child:
1:b0396f5cb9eb
Commit message:
Initial commit

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
HTTPClient.lib Show annotated file Show diff for this revision Revisions of this file
YoApi.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetInterface.lib	Wed Jun 25 13:14:51 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/EthernetInterface/#e6b79f0ccd95
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClient.lib	Wed Jun 25 13:14:51 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/HTTPClient/#277279a1891e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/YoApi.lib	Wed Jun 25 13:14:51 2014 +0000
@@ -0,0 +1,1 @@
+YoApi#013176e14f42
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jun 25 13:14:51 2014 +0000
@@ -0,0 +1,37 @@
+/** YoApi Example
+ *  Copyright (c) 2014, Takuya Urakawa
+ *  
+ *  Send Yo from mbed.
+ *  You can get your Yo API token from https://medium.com/@YoAppStatus/yo-developers-api-e7f2f0ec5c3c
+*/
+
+#include "mbed.h"
+#include "EthernetInterface.h"
+#include "HTTPClient.h"
+#include "YoApi.h"
+
+const char* apiToken = "YOUR_API_TOKEN";
+
+EthernetInterface eth;
+HTTPClient http;
+YoApi yo(http,apiToken);
+
+int main() {
+    printf("Yo from mbed\n");
+    printf("Ethernet initializing\n");
+    eth.init();
+    eth.connect();
+    
+    //Yo!
+    int ret = yo.send();
+    if(!ret) {
+      printf("YO!\n");
+    }else{
+        printf("Error - ret = %d\n", ret);
+    }
+    
+    printf("Disconnect Ethernet\n");
+    eth.disconnect();  
+    
+    return 0;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Wed Jun 25 13:14:51 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#ac8d036315ed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jun 25 13:14:51 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/024bf7f99721
\ No newline at end of file