Need quick help with Memsic 2125.

I am following this guide here http://www.instructables.com/id/Arduino-Micro-Electronic-Bubble-Level/

For some reason the two 2125s I bought dont seem to do anything. They lock the X and Y values at 345 and 355 respectively.

When I follow this guide here Arduino Project Hub

The serial monitor has values locked at 4000 on both axis.

I have no idea whats going on. Can someone help me troubleshoot?

Start by posting an example of the code that you are testing, perhaps from the second page you link to, and a circuit diagram of your setup.

const int xP = 11;
const int yP = 12;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);

pinMode(xP, INPUT);
pinMode(yP, INPUT);

}

void loop() {
// put your main code here, to run repeatedly:
int px, py;
int ax, ay;

px = pulseIn(xP, HIGH);
py = pulseIn(yP, HIGH);

ax = ((px / 10) - 500) * 8;
ay = ((py / 10) - 500) * 8;

Serial.print(ax);
Serial.print("\t");
Serial.print(ay);
Serial.println();

delay(100);

}

The code is as above and the circuit diagram is exactly this

const int xP = 11;
const int yP = 12;

  pinMode(xP, INPUT);
  pinMode(yP, INPUT);

  px = pulseIn(xP, HIGH);
  py = pulseIn(yP, HIGH);

The code appears to use pins 11 and 12 but the circuit doesn't

Am I missing something obvious ?

UKHeliBob:

const int xP = 11;

const int yP = 12;

pinMode(xP, INPUT);
  pinMode(yP, INPUT);

px = pulseIn(xP, HIGH);
  py = pulseIn(yP, HIGH);



The code appears to use pins 11 and 12 but the circuit doesn't

Am I missing something obvious ?

I changed that part of the code to correct pins and its still locked to 4000 :confused:

Obviously you need to check the wiring, connections and breadboard carefully. What readings do you get if you disconnect the 2125 output lines from the circuit ?