O'Reilly logo

Arduino Android Blueprints by Stefan Buttigieg, Marco Schwartz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Android Phone Sensor

In this book so far, we have used an Android device to control Arduino projects and get readings from sensors connected to the Arduino board. In this chapter, we will do something different: we will use the phone's sensors to control an Arduino board.

We will connect a servomotor to an Arduino board so that it can be controlled from the Android phone. A servomotor is basically a motor whose angular position can be precisely controlled by a microcontroller. We will use BLE once more to receive commands from the Android device.

On the Android side, we will basically measure data coming from the phone's gyroscope sensor continuously and convert this data into meaningful commands for the servo. The goal is that the servo ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required