for orginal PCB
Dependencies: EthernetInterface SCP1000 WebSocketClient mbed-rtos mbed
Fork of ku-make_sensor201302 by
Diff: main.cpp
- Revision:
- 4:99410a172710
- Parent:
- 3:49cc55a3a463
- Child:
- 5:8d05d8d98218
--- a/main.cpp Sat Feb 09 17:10:58 2013 +0000 +++ b/main.cpp Sat Feb 09 18:15:18 2013 +0000 @@ -13,8 +13,9 @@ int main() { - const char apikey[] = "xxxxxxxxxxxxxxxxxxxxxx"; //your apikey - const char feed[]= "/feeds/00000"; //your feed URL + const char apikey[] = "xxxxxxxxxxxxxxxxxxxxxx"; //Change your apikey + const char feed[]= "/feeds/00000"; //Change your feed URL + char cms[512]; char recv[512]; int token = 0; @@ -39,7 +40,7 @@ humid = humid_in; hpa = scp1000.readPressure(); - // If you wish, please change the value. + // If you want, please change the value. r_light = light * 3.3 * 5 / 0.013; r_temp = temp * 3.3 * 100 - 60 - 1; r_humid = humid * 3.3 * 100 + 2; @@ -47,7 +48,7 @@ myled = 1; - // If you wish, please change the ID,Number of digits. + // If you want, change the ID, Number of digits. sprintf (cms,"{\"method\" : \"put\",\"resource\" : \"%s\",\"params\" : {},\"headers\" : {\"X-ApiKey\":\"%s\"},\"body\" :{\"version\" : \"1.0.0\",\"datastreams\" : [{\"id\" : \"0\",\"current_value\" : \"%4.0f\"},{\"id\" : \"1\",\"current_value\" : \"%4.0f\"},{\"id\" : \"2\",\"current_value\" : \"%3.0f\"},{\"id\" : \"3\",\"current_value\" : \"%3.0f\"}]},\"token\" : \"0x%d\"}\r\n",feed,apikey,r_hpa,r_light,r_temp,r_humid,token); printf ("%s\r\n",cms); @@ -62,6 +63,7 @@ } ws.close(); + // If you want, change the Interval. wait(300); }