Problem with MMA8452Q Accelorometer

I did all the previous plug and code, but the Serial Monitor Only shows

I2C Scanner
Scanning...
No I2C devices found

I2C Scanner
Scanning...
No I2C devices found...

Any clue?

Thx

jahnavi:
Hi,

When the i2c_scanner code is used then i am getting the output as

I2C Scanner
Scanning...
I2C device found at address 0x1D !
done

When i use the attached code in the previous post then i am getting output as follows ( when the accelerometer is held at a fixed position also there are variations in the readings)

MMA8452 Basic Example
MMA8452Q is online...
0.14 0.60 -6.23
2.76 1.12 9.38
2.80 1.14 9.40
2.78 1.13 9.37
2.78 1.20 9.36
2.82 1.18 9.42
2.80 1.16 9.42
2.76 1.15 9.40
2.78 1.16 9.40
2.81 1.17 9.43
2.80 1.17 9.42
2.84 1.15 9.39
2.79 1.22 9.40
2.80 1.23 9.43
2.78 1.20 9.39
2.83 1.17 9.34
2.77 1.14 9.42

All the values are interms of g. Normally when the accelerometer is not moving then the acceleration should be 0 but here it is showing some value. Can you please tell me why is it so?

Thank you

Krodal:
It's hard to look at the code and see exactly what it is doing.

Your sensor is probably a MEMS sensor, and fluctuation is normal.
MEMS - Wikipedia

My problem with Sparkfun code is, that an error is no passed on to higher levels. For example the Wire.endTransmission() function returns a value if something is wrong. But with the code you use, you don't know if something is wrong.