Example program streaming accelerometer data to a websocket server over a Sprint Mobile Broadband connection
Dependencies: MMA7660 SprintUSBModem WebSocketClient mbed-rtos mbed
Diff: main.cpp
- Revision:
- 7:e61aa764fba4
- Parent:
- 6:b3fc13de8f5e
--- a/main.cpp Fri Oct 26 09:50:24 2012 +0000 +++ b/main.cpp Wed Oct 31 00:40:09 2012 +0000 @@ -7,13 +7,17 @@ void test(void const*) { - SprintUSBModem modem; - Websocket ws("ws://sockets.mbed.org/ws/sensors/wo"); + SprintUSBModem modem(p18); + Websocket ws("ws://sockets.mbed.org:443/ws/sensors/wo"); + // View the output at : + // http://tools.mbed.org/iot/ + // Click "show all" char json_str[100]; - Thread::wait(5000); printf("Switching power on\r\n"); + modem.power(true); + int ret = modem.connect(); if(ret) {