Go Down

Topic: Accelerometer ADXL 335 (Read 671 times) previous topic - next topic

xpurexheartx

Hello.
I'm doing an object that will behave differently depending on the side that is on. I'm using an ADXL 335 accelerometer and, on the sample code that is on the arduino website the values are normal and I implemented a version of it that works perfectly. The problem is when I put the code into the bigger code that has all the other behaviours the values of the Accelerometer change.... in exactly the same position... in one (the original arduino sample) the value is of 500 and when is on the other the value is 280..

Does anyone have an Idea why might this be?

robtillaart

Quote
Does anyone have an Idea why might this be?   ...   The problem is when I put the code into the bigger code


Seems that the bigger code affects the example code. Without posting your code no-one can tell the real cause

You should rewrite the sample code to a "isolated " function that is called when needed and therefor less affected by the bigger code. There is allways at least the effect that the big code takes time and memory and ...

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

aero_guy


The problem is when I put the code into the bigger code


It has happened to me a few times with different sensors, a common reason is that you are messing up the order of the functions.
If the "example" code has calibrations, or anything of that nature, make sure to place those before your void loop.

Again, posting the code will help us identify your problem.

Go Up