Hi every body! i bought a mma7361 accelerometer like this:
http://thmb.inkfrog.com/thumbn/geiliablestore/mma7361_conew1.jpg=450I guess it could be use through i2c or analog in, and i want to use it via analog in!
I plugged like this:
A0 to X
A1 to Y
A2 to Z
3.3V to 3V3
GND to GND
and i had this code:
#include <SoftwareSerial.h>
int axe_x=0;
int axe_y=0;
int axe_z=0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
axe_x=analogRead(A0);
axe_y=analogRead(A1);
axe_z=analogRead(A2);
Serial.print(axe_x);
Serial.print("\n");
Serial.print(axe_y);
Serial.print("\n");
Serial.print(axe z);
Serial.print("\n");
}
but in the terminal there is only some strange values, all the same for each axis, and wich don't move when shaking the accelerometer!
Any ideas what i m doing wrong?