MMA8452Q not connecting, getting stuck at "accel.begin()"

Hello,

I bought a MMA8452Q and have connected it according to the hookup guide (https://learn.sparkfun.com/tutorials/mm … okup-guide)

I’m using an Arduino Leonardo, so the SDA and SDL of the accelerometer are hooked up to the SDA and SDL of the Leonardo with a 330 ohm resistor between. The GND is hooked up to ground and 3.3V to the 3.3V pin on the Arduino.

I’m using this example code: https://github.com/sparkfun/SparkFun_MM … tation.ino

The library is added correctly and the code compiles.

However, the accelerometer gets stuck at the “accel.begin()” step, on line 41.

Hi cjohnson57,

Are you getting this error “Not Connected. Please check connections and read the hookup guide.” when you open a serial monitor? If that’s the case, it might be a connection issue. Can you take a few photos of your circuit and attach them to your response?

Hello,

Sorry for the late reply, I was very busy.

It turns out the issue was that the SCL and SDA ports on the Arduino Leonardo were not the pins labeled SCL and SDA, but rather pins 3 and 2, respectively.

Not a problem, I am glad to hear it was just a simple connection/pin issue that you were able to figure out.

Happy hacking!