O'Reilly logo

Arduino Development Cookbook by Cornel Amariei

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

Accelerometer

Accelerometers are advanced components that can measure acceleration. Initially, they were designed for airplanes and rockets, but now we can find them in any phone, laptop, hard drive, and a whole bunch of toys.

By measuring acceleration, we can determine if an object is moving, how rapidly it is changing direction, and benefit from its most popular use—determining the orientation of the object. Accelerometers come in various types and the number of axes they can sense is the basis of their categorization. Now, almost all accelerometers can sense three axes—meaning they can sense acceleration in any direction it happens.

In this example, we will read the data from the accelerometer and print it over a serial connection.

Getting ready ...

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