Leonardo freezes using I2C Accelerometer

I'm using Sparkfun's MMA8452A accelerometer. I tried the sample program (here) - I changed the delay from 10mS to 200mS so it didn't scroll on the serial monitor so fast. The sketch works fine on an Uno and Duemilanove, but when I try it on a Leonardo, the sketch runs for about 30 seconds, then freezes. You communicate with the accelerometer via I2C. I've got resistors hooked up as suggested: 330 ohm in line with SDA and SCL. Pull-up resistors are on the breakout board. I2C wires are only a few inches long. Any idea why this doesn't work on Leonardo?

I don't know, but I do know why the Leonardo is different.

The Leonardo detects a digital input as a '1' at a lower voltage. That makes the Leonardo compatible with 3.3V signals. You could try without the 330 ohm resistors.

The Leonardo uses a software serial port (the virtual serial port via the usb). That is slower than the hardware serial port. You could try to reduce the serial data even more.

Erdin: I don't know, but I do know why the Leonardo is different.

The Leonardo detects a digital input as a '1' at a lower voltage. That makes the Leonardo compatible with 3.3V signals. You could try without the 330 ohm resistors.

The Leonardo uses a software serial port (the virtual serial port via the usb). That is slower than the hardware serial port. You could try to reduce the serial data even more.

I changed Serial.begin() to 9600, that didn't help. Then I bypassed the 330 ohm resistors, that didn't help either.

I have no clue. Perhaps the cable is not good and the voltage is too low.

I hope someone else has better ideas.

I have an this I2C level shifter I want to try to see if that helps.

Give it a try. The Leonardo doesn't need it, but it can't hurt either.