Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You want to respond to the rate of rotation. This can be used to keep a vehicle or robot moving in a straight line or turning at a desired rate.
Gyroscopes provide an output related to rotation rate (as opposed to an accelerometer, which indicates rate of change of velocity). Most low-cost gyroscopes use an analog voltage proportional to rotation rate, although some also provide output using I2C (see Chapter 13 for more on using I2C to communicate with devices). This recipe works with a gyro with an analog output proportional to rotation rate. Figure 6-17 shows an LY530AL breakout board from SparkFun. Many low-cost gyros, such as the one used here, are 3.3V devices and must not be plugged in to the 5V power pin.