src/ModMMA8452Q.cpp
byte MMA8452Q::readRegister(MMA8452Q_Register reg)
{
	Wire.beginTransmission(address);
	Wire.write(reg);
	//endTransmission but keep the connection active
	if (Wire.endTransmission(false) == 0)
	{
        //Ask for 1 byte, once done, bus is released by default
    	if (Wire.requestFrom(address, 1) == 1)
    	    return Wire.read();
	}

    return 0;
}
// READ A SINGLE REGISTER
//	Read a byte from the MMA8452Q register "reg".
READ A SINGLE REGISTER
Read a byte from the MMA8452Q register "reg".
READ A SINGLE REGISTER Read a byte from the MMA8452Q register " reg " .
byte MMA8452Q::readRegister(MMA8452Q_Register reg)
{
	Wire.beginTransmission(address);
	Wire.write(reg);
	if (Wire.endTransmission(false) == 0)
	{
    	if (Wire.requestFrom(address, 1) == 1)
    	    return Wire.read();
	}
    return 0;
}
byte MMA8452Q :: readRegister ( MMA8452Q_Register reg ) { Wire . beginTransmission ( address ) ; Wire . write ( reg ) ; if ( Wire . endTransmission ( false ) == 0 ) { if ( Wire . requestFrom ( address , 1 ) == 1 ) return Wire . read ( ) ; } return 0 ; }
READ A SINGLE REGISTER
Read a byte from the MMA8452Q register "reg".
READ A SINGLE REGISTER Read a byte from the MMA8452Q register " reg " .
//endTransmission but keep the connection active //Ask for 1 byte, once done, bus is released by default