Modifed version from Samuel Mokrani Changed URL to push data to sensor page Added visualisation page URL as a comment

Dependencies:   EthernetInterface MMA7660 WebSocketClient mbed-rtos mbed LM75B

Fork of Websocket_Ethernet_acc by Samuel Mokrani

Files at this revision

API Documentation at this revision

Comitter:
chris
Date:
Fri Oct 26 09:27:16 2012 +0000
Parent:
0:11bb5faeb547
Child:
2:1fae595547d5
Commit message:
Changed the URL to feed data to a graph

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Oct 26 09:11:00 2012 +0000
+++ b/main.cpp	Fri Oct 26 09:27:16 2012 +0000
@@ -17,12 +17,13 @@
     eth.init(); //Use DHCP
     eth.connect();
     printf("IP Address is %s\n\r", eth.getIPAddress());
- 
-    Websocket ws("ws://sockets.mbed.org/ws/demo/wo");
+    
+    Websocket ws("ws://sockets.mbed.org/ws/sensors/wo");
+    // visit http://tools.mbed.org/iot/ to see the realtime graph
     ws.connect();
  
     while (1) {
-        sprintf(json_str, "{\"id\":\"app_board_acc\",\"ax\":\"%d\",\"ay\":\"%d\",\"az\":\"%d\"}", (int)(MMA.x()*200), (int)(MMA.y()*200), (int)(MMA.z()*200));
+        sprintf(json_str, "{\"id\":\"mbed-app-board\",\"ax\":\"%d\",\"ay\":\"%d\",\"az\":\"%d\"}", (int)(MMA.x()*200), (int)(MMA.y()*200), (int)(MMA.z()*200));
         ws.send(json_str);
         wait(0.2);
     }