Send Yo from mbed! http://www.justyo.co/
Dependencies: EthernetInterface HTTPClient YoApi mbed-rtos mbed
Diff: main.cpp
- Revision:
- 0:4d758dace8b9
--- /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