📜 ⬆️ ⬇️

MacBook and accelerometer

image Studying the HTML5 presentation, I stumbled upon an amazing feature of my MacBook. When I reached the slide about the orientation of the device, I for some reason lifted the laptop and ... found that it has an accelerometer. And it is quite affordable for use by mere mortals.

Google shed light on the question. It turns out that SMS (Sudden Motion Sensor), has been living in MacBooks for a long time, is exposed as an API out, and there are even a number of applications and games for Macs using this feature.

A couple of clips with the most interesting (as it seemed to me) of them.

SmackBook - Expose switch on a light knock on a laptop.

')
Neverball - an example of a toy on Mac with an accelerometer


Of the possible interesting uses, I thought of writing an extension for Chrome (or any other browser that supports the deviceorientation event), which would lightly knock the current page. True, it would be necessary to fine tune the algorithm to avoid false positives.

Ps. Immediately I apologize to those for whom “I discovered America,” but if I hadn’t accidentally stumbled upon it in my life I wouldn’t have guessed that something like that lives in the depths of my laptop.

Source: https://habr.com/ru/post/119879/


All Articles