Go Down

Topic: Accelerometer MMA7361 readings (Read 1 time) previous topic - next topic


I have problems with the sparkfun MMA7361 readings, I only detect significant changes when for example, rotate the accelerometer along it's x axis (the y value changes indicating up/down), and so on, but when I move the accelerometer up and down and not along one axis, I don't detect anything, what's the problem with my readings... Thanks... PD, I connected all of the pins except ST (selftest) and the 0g and gselec....

Code: [Select]

#include <AcceleroMMA7361.h>

AcceleroMMA7361 accelero;

int x_change;
int y_change;

int x;
int y;
int z;
void setup()
accelero.begin(13, 12, 11, 10, A4, A2, A0);
void loop()
 x_change = x - accelero.getXAccel();
 y_change = y - accelero.getYAccel();
 x = accelero.getXAccel();
 y = accelero.getYAccel();
 if(x_change > 20)
 else if (x_change < -20)
 if(y_change > 15)
 else if(y_change < -15)


You have to be quite observant to notice the output change when you move it.

Also,  if you move it at a steady speed upwards,  it's not accelerating,  it's moving at a steady speed.

You'd only see an acceleration at the beginning and end of that motion.

If you turn it over and over  and the apparent x,y,z vector of the result is pointing down,  then
it is probably working.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131