Pages: [1]   Go Down
Author Topic: Accelerometer ADXL 335  (Read 640 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 223
Posts: 13876
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: