Automation

What your phone and its sensors can do in a browser

Adam Hughes writes about the sensors contained in modern smartphones and how they can be used, especially with web browsers.

Your phone is dense with sensors. Cameras and microphones, of course, but also accelerometers, gyroscopes, magnetometers, ambient light sensors, GPS, Bluetooth radios. Most of them are accessible from a web page — a single HTML file, no app store involved. I built a series of small demos to see how far you can get with just <canvas>, the Web APIs, and a couple hundred lines of JavaScript each.

Each demo is one self-contained file. Open it on your phone over HTTPS, grant the permission it asks for, watch the sensor become a thing you can see, hear, or play with.

There are 23 demonstrations. An example is a Guitar Tuner.

You can read more on this open source work here. The MIT licensed code is on GitHub.

— Source: Adafruit Industries – Makers, hackers, artists, designers and engineers! — Read More

Related Articles

Back to top button