HTML sensor data

Your question as asked is much too broad for this site. With that said, here’s how I implemented a solution:

Create a node.js server. You will want to be able to serve up html pages. Add socket capability. Generate a webpage for the mobile device. The webpage will use the device orientation API to determine tilt (or whatever..) Obviously you will be using JavaScript for this. Connect the mobile device to the the server via sockets. Send the orientation data from the mobile device to the server. Save the data in a temporary holding location. Create another webpage on the server that displays data from the temporary holding location.

I ended up with a voting system with 50 users who just had to tilt their phones to vote. Note: The tilt thing was very odd… In IOS the tilt floats up, in Android the same tilt motion floats down.

This took me a couple of days to implement, including learning time on how sockets really works, and to hone my node.js skills. I had a lot of fun and I learned a lot. I’m hoping it will work that way for you, too. Good luck.

Leave a Comment