Book Image

Arduino Robotic Projects

By : Richard Grimmett
Book Image

Arduino Robotic Projects

By: Richard Grimmett

Overview of this book

Table of Contents (21 chapters)
Arduino Robotic Projects
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Accessing the accelerometer from the Arduino IDE


Now that the two devices are connected, you'll need to bring up the Arduino IDE and add a library so that you can access the functionality from the SW. Follow these steps:

  1. Go to github.com/jrowberg/i2cdevlib and look on the right-hand side of the page for the download link. This will download the entire library.

    Note

    From the SparkFun page on the device at www.sparkfun.com/products/11028, you'll find a GitHub repository that supports not only this device, but a number of devices that use the I2C interface.

  2. Now, you should unzip the file to a handy location; I unzipped mine in the Downloads directory. What you want is just the files associated with Arduino, so go to the directory that supports those files, as shown in the following screenshot:

  3. Even though you won't need all of these libraries right now, you can just copy all of these to your Libraries directory of your Arduino for future use. You'll notice, by the way, that there is a duplicate...