Arduino-Detecting Rotation Using a Gyroscope:
Most low-cost gyroscopes use an analog voltage proportional to rotation rate, although some also output using I2C. This recipe works with a gyro with an analog output proportional to rotation rate. Figure 6-16 shows an LISY300AL breakout board from SparkFun. Many low-cost gyros, such as the one used here, are 3.3V devices and must not be plugged into the 5V power pin.The Gyro OUT connection is the analog output and is connected to Arduino analog input 0. The PD connection enables the gyro to be switched into low power mode and is connected to analog pin 1 (in this sketch, it is used as a digital output pin). You can connect PD to any digital pin; the pin used here was chosen to keep the wiring neater. If you don’t need to switch the gyro into low-power mode, you can connect the PD line to Gnd.
Most low-cost gyroscopes use an analog voltage proportional to rotation rate, although some also output using I2C. This recipe works with a gyro with an analog output proportional to rotation rate. Figure 6-16 shows an LISY300AL breakout board from SparkFun. Many low-cost gyros, such as the one used here, are 3.3V devices and must not be plugged into the 5V power pin.The Gyro OUT connection is the analog output and is connected to Arduino analog input 0. The PD connection enables the gyro to be switched into low power mode and is connected to analog pin 1 (in this sketch, it is used as a digital output pin). You can connect PD to any digital pin; the pin used here was chosen to keep the wiring neater. If you don’t need to switch the gyro into low-power mode, you can connect the PD line to Gnd.