Datasheet
Arduino
The Adafruit L3GD20 Library for the Arduino implements a convenient device class to handle the the low-level device
communication with the Gyro module. The programming interface is described below:
Install Arduino Libraries
Before you can use the L3GD20, you'l need to install the required libraries using the Arduino Library Manager, which
you can open via the menu entry shown below:
You will need to install the Adafruit Unified Sensor library ...
... as well as Adafruit L3GD20 U:
Construction:
To use the L3GD20 in your sketch, you must first call a constructor to create a device object. There are two forms of
the constructor:
Adafruit_L3GD20(void);
Adafruit_L3GD20(int8_t cs, int8_t mosi, int8_t miso, int8_t clk);
The first version takes no parameters and is used for I2C communication. The second version is for SPI
communication and requires that you specify the pins to be used.
I2C Example: (use with I2C wiring (https://adafru.it/aV6))
// No need to specify pins for I2C
Adafruit_L3GD20 gyro();
© Adafruit Industries https://learn.adafruit.com/adafruit-triple-axis-gyro-breakout Page 8 of 18