Everyone, sorry for the radio silence (was dealing with some personal issues).

Thanks for all your insight.

I'm back now with some more questions after reading your comments - I'd really appreciate your help once again.

pylon,

In regards to these comments:

Put the processor to sleep during the ADC measurement (there's a special sleep state for this).

So the faster your measuring the better the integration, but with faster measurements the measurement error from the ADC will increase so you probably have to play with the values to get the best settings for your case.

do you mean by, analog to digital conversion process (done by the processor???) is the cause of potential inaccuracy of the double integration?

What exactly is "measurement error from the ADC"? Does that happen all the time? (for example, does the ADC process to readings from simple analog input such as a potentiometer and using that to dim LED - also has some errors!?) Sorry if this is common sense, but it would be great if you could explain what/how/why that happens?

Also regarding

The posted code doesn't contain a double integration. Was that planed for a later version?

My code doesn't contain double integration. I don't know how to do double integration

I just know that method double integration exists, but I don't know how to execute it.

I'm using this code instead:

`int accelerationX = abs(averageX - lastX);`

lastX = averageX;

return accelerationX;

^This is how I (probably inaccuratly)

calculate acceleration, as a replacement for going through all the fuss of double integration, as of now (still struggling to find out how to do double integration).averageX is the "current" reading and lastX is the "previous" reading of the x-value of the sensor.

1) I subtract lastX from averageX and make sure it's a positive value using "abs". Store that as "accelerationX"

2) I update lastX with the "current" reading after, so it can be used in the next round of loop.

3) "accelerationX" is returned. It's used as the acceleration value for x-axis.

Please point out if you think this won't work to calculate acceleration/if there's a fundamental error?

I would expect at least one axis to be substantially greater than 0 (at least if you're not measuring in space).

This does not happen (when adxl335 is static) because I am

subtracting the "previous" reading from the "current" reading. (e.g. if the previous reading was 100 and current reading is 100.1, 100.1 - 100 = 0.1, meaning virtually zero difference.)

As the sensor is measuring acceleration a double integration is the way to go to get a distance (after the first integration you get a speed, the second integration results in a distance). The problem is that you don't ever get exact results with this method as the time slots between measurements should be infinitely small.

Ah Okay - so how double integration works is -

by frequently checking how much the gravitational pull has changed from "last reading" to "current reading", I can figure out how much velocity has changed over a certain distance, thus figure out acceleration??? And, because the Arduino has to check this so frequently, the process is too heavy for the processor of Arduino???Sorry for so many questions, but I really want to get the accelerometer to work.

Thanks so much again for your help!