Example project showing temperature posted to sockets.mbed.org
Dependencies: LM75B SprintUSBModem WebSocketClient mbed-rtos mbed
Fork of SprintUSBModemWebsocketTest by
Revision 1:380f5db5d004, committed 2012-10-31
- Comitter:
- chris
- Date:
- Wed Oct 31 19:32:31 2012 +0000
- Parent:
- 0:162f8f714dcc
- Child:
- 2:72c06f2902d5
- Commit message:
- First commit
Changed in this revision
LM75B.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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LM75B.lib Wed Oct 31 19:32:31 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/chris/code/LM75B/#6a70c9303bbe
--- a/main.cpp Tue Oct 30 10:01:33 2012 +0000 +++ b/main.cpp Wed Oct 31 19:32:31 2012 +0000 @@ -1,12 +1,16 @@ #include "mbed.h" #include "SprintUSBModem.h" #include "Websocket.h" +#include "LM75B.h" void test(void const*) { + LM75B tmp(p28,p27); + SprintUSBModem modem(p18); Websocket ws("ws://sockets.mbed.org:443/ws/demo/rw"); char recv[128]; + char msg[32]; Thread::wait(5000); printf("Switching power on\r\n"); @@ -27,7 +31,8 @@ { if(!(i%100)) { - int ret = ws.send("WebSocket Hello World!"); + sprintf(msg, "Temp = %.1f",tmp.read()); + int ret = ws.send(msg); if(ret<0) { printf("Timeout\r\n");