Got my first arduino yesterday, ran through a bunch of the tutorials and finally hooked up the MMA7361 accelerometer I got with it. Hooked it up on a breadboard, checked all connections, (old electronics hobbyist, this no solder stuff is too easy!) used an example sketch that I made sure matched my pinout and it compiled fine. Everything works, leds, serial output, get all three axis readings, only they won't change no matter how I tilt, turn, move the breakout board.
I even tried other generic sketches for accelerometers, no luck. Since it is adustable I tried setting the sensitivity higher, still no luck.
Voltage readings are in the range of 1650 mv for the x&y axis and 2450 mv when on the 1.5G setting, 1672 for x&y and 1880 mv on the 6G setting.
Tried getting the results as G-force and raw data, everything stays the same. Here is the sketch, am I forgetting something?
// sleepPin = 13, selfTestPin = 12, zeroGPin = 11, gSelectPin = 10, xPin = A0, yPin = A1, zPin = A2.
#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(3.3); //sets the AREF voltage to 3.3V
accelero.setSensitivity(LOW); //sets the sensitivity to +/-6G
accelero.calibrate();
}
void loop()
{
x = accelero.getXVolt();
y = accelero.getYVolt();
z = accelero.getZVolt();
Serial.print("\nx: ");
Serial.print(x);
Serial.print("mV\ty: ");
Serial.print(y);
Serial.print("mV\tz: ");
Serial.print(z);
Serial.print("mV");
delay(500); //make it readable
}
Thanks
TJ