This is an experiment using a HTML5 WebSocket to communicate real-time data from an embedded system to the browser. Here an ultrasonic distance measuring module and a mBed micro-controller to serve the real time data to the browser. The mBed is running an application that provides a HTTP server with WebSockets capability. When the page is loaded the demo program makes a WebSocket connection to the mBed. It sends the magnitude time response of the ultrasonic "pings". Each message is a JSON array with 100 magnitudes (each representing about 9mS), which are draw and scrolled to a HTML5 canvas by the JavaScript code in the browser.
Update: I've created an mBed notebook with the code: http://mbed.org/users/nandgate/notebook/websockets/
Link to this comment:
All Comments (0)