Sample Electric Imp code for reading i2c registers of MMA8452Q accelerometer
See electricimp.com
See https://www.sparkfun.com/products/10955 for MMA8452Q accelerometer breakout board