Arduino and Digital Accelerometer ADXL345 I2C

posted in: Arduino | 15

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
 

15 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. ds

    Hello, upload the adruino code into the adruino board, and what about the ADXL library? what should i do with that?

  3. 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.

      • Ahmad Ali

        error saying: no matching function for call to ‘ADXL345::ADXL345()’
        plz help me with it

  4. Abdul Rehman

    Is code transfered on accelerometer is changeable?
    (Beginner)

  5. Abdul

    hello,how can i get graph of linear acceleration(in m/s2) agianst time(sec).i am struggling in every tutorial they code for angle i want to use accelerometer for vibration measurement .please help

  6. Ahmad Ali

    i have some questions to ask:
    1. can i use this code on arduino uno??
    2. ADXL345 library given is for PIC Micro-controller (CSS)… we have to add library on arduino also?? or copying code will work??
    plz reply me i got the same 10 pin Accelerometer you have… can’t get help from other tutorials

  7. Ahmad Ali

    error saying: no matching function for call to ‘ADXL345::ADXL345()’

Leave a Reply to Abdul Rehman Cancel reply

Your email address will not be published. Required fields are marked *