Chapter 9. Position sensors

In chapter 2, you shook your phone and made a sheep disappear using the phone’s accelerometer sensor. Most phones have sensors that can detect much smaller motions than a strong shake. You can see this when you tilt the phone to one side and the display rotates, or if you’ve played a driving game where you steer left and right by gently tilting the phone. Phones can tell which way up they’re facing—for instance, some people set their phone’s ringer to be silent automatically if the phone is face down on a desk. Your phone can also tell which direction is north by using its own built-in compass.

All the apps in this ...

Get Hello App Inventor! now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.