Hey guys,
I wanted to pretend to be the 'macho' in electronics and I told my teacher to give me one of his projects that involves the accelerometer MMA7361L and the Arduino but now I'm in trouble as I don't know how to connected it.
I have the schematic diagram of the MMA7361L and it basically tells you what to do (I haven't included the capacitors on the X, Y, Z outputs because I don't have those now but I don't think it shouldt affect the output values drastically?).
The problem is, I wire it up, I write a basic code and then I get some values ranging from 300 to 100 without even moving the circuit.
I found the very same problem on a different forum but in the end nobody said what the problem was, I actually cheated and copied and paste the code.
int XPin = 1; // X
int YPin = 2; // Y
int ZPin = 3; // Z
int valX = 0;
int valY = 0;
int valZ = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
valX = analogRead(XPin);
valY = analogRead(YPin);
valZ = analogRead(ZPin);
Serial.print("X-");
Serial.print(valX);
Serial.print(" Y-");
Serial.print(valY);
Serial.print(" Z-");
Serial.print(valZ);
Serial.print("\n");
delay(100);
}
Like I said, there's no connection of capacitors on the outputs but there is one capacitor across the power pins.
Can I anybody help me find what the problem is? attached is the datasheet of the MMA7361L, thanks a million!
I wanted to pretend to be the 'macho' in electronics and I told my teacher to give me one of his projects that involves the accelerometer MMA7361L and the Arduino but now I'm in trouble as I don't know how to connected it.
I have the schematic diagram of the MMA7361L and it basically tells you what to do (I haven't included the capacitors on the X, Y, Z outputs because I don't have those now but I don't think it shouldt affect the output values drastically?).
The problem is, I wire it up, I write a basic code and then I get some values ranging from 300 to 100 without even moving the circuit.
I found the very same problem on a different forum but in the end nobody said what the problem was, I actually cheated and copied and paste the code.
int XPin = 1; // X
int YPin = 2; // Y
int ZPin = 3; // Z
int valX = 0;
int valY = 0;
int valZ = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
valX = analogRead(XPin);
valY = analogRead(YPin);
valZ = analogRead(ZPin);
Serial.print("X-");
Serial.print(valX);
Serial.print(" Y-");
Serial.print(valY);
Serial.print(" Z-");
Serial.print(valZ);
Serial.print("\n");
delay(100);
}
Like I said, there's no connection of capacitors on the outputs but there is one capacitor across the power pins.
Can I anybody help me find what the problem is? attached is the datasheet of the MMA7361L, thanks a million!
Attachments
-
170.4 KB Views: 35