Arduino and Digital Accelerometer ADXL345 I2C

posted in: Arduino | 4

Download # Arduino Code (*.ino file)

Download # ADXL345 library (*.rar file)
or
Upload Arduino code directly to your Microcontroller from website

If you want to integrate Arduino IDE into your website (as above) sign up here: codebender
 
[kad_youtube url=”https://www.youtube.com/watch?v=omZ538TElCU&index=14&list=PLdov47qfNta3acHYXtOGUuGxo-bk5rpEy” ]

4 Responses

  1. Joe Oliveri

    Hello, I was wondering if I could use this library on a 2-axis accelerometer. I will download the library now and see if you utilize function overloading so that I can pass in only values for the x and y axis; but if not, do you have any ideas? I have a 2-axis accelerometer that is hooked up for I2C ONLY. Please let me know if you have any suggestions or advice. Thank you. -Joe

    • admin

      ADXL345 is a 3-axis accelerometer and using the library provided, you should not have problems in acquiring that information. I2C works perfectly for that.

  2. Abiam

    hello, i want to know why you add this part?:

    // the following 3 lines is for an offset
    rawX=x-7;
    rawY=y-6;
    rawZ=z+10;

    Why you subtract -7 to x and subtract -6 to Y and after add 10 to z?

    Where did you find those values?

    • admin

      Hello, it’s just an offset because of improper sensor alignment in horizontal plane.

Leave a Reply