So I bought a MMA7361 accelerometer from sparkfun.
I searched for different programs online to get basic info from the accelerometer.
The program I use now came from http://www.geeetech.com/wiki/index.php/MMA7361_Triple_Axis_Accelerometer_Breakout
I downloaded the library they provided, but it still doesn't work.
Instead of getting values of about 10-100 when I move it, it starts with values between 200 and 400, and then jumps random to numbers up to 800 and then down to -100, while the meter isn't moving...
What's wrong?
#include <AcceleroMMA7361.h>
AcceleroMMA7361 accelero;
int x;
int y;
int z;
void setup()
{
Serial.begin(9600);
accelero.begin(13, 12, 11, 10, A0, A1, A2);
accelero.setARefVoltage(5); //sets the AREF voltage to 3.3V
accelero.setSensitivity(LOW); //sets the sensitivity to +/-6G
accelero.calibrate();
accelero.wake();
}
void loop()
{
x = accelero.getXAccel();
y = accelero.getYAccel();
z = accelero.getZAccel();
Serial.print("\nx: ");
Serial.print(x);
Serial.print(" \ty: ");
Serial.print(y);
Serial.print(" \tz: ");
Serial.print(z);
Serial.print("\tG*10^-2");
delay(500); //make it readable
}