lib/Seeed_Arduino_AS5600/AS5600.cpp
/*******************************************************
  Method: readOneByte
  In: register to read
  Out: data read from i2c
  Description: reads one byte register from i2c
*******************************************************/
readOneByte
In: register to read
Out: data read from i2c
Description: reads one byte register from i2c
readOneByte In : register to read Out : data read from i2c Description : reads one byte register from i2c
int AMS_5600::readOneByte(int in_adr)
{
  int retVal = -1;
  Wire.beginTransmission(_ams5600_Address);
  Wire.write(in_adr);
  Wire.endTransmission();
  Wire.requestFrom(_ams5600_Address, 1);
  while (Wire.available() == 0)
    ;
  retVal = Wire.read();
  return retVal;
}
int AMS_5600 :: readOneByte ( int in_adr ) { int retVal = -1 ; Wire . beginTransmission ( _ams5600_Address ) ; Wire . write ( in_adr ) ; Wire . endTransmission ( ) ; Wire . requestFrom ( _ams5600_Address , 1 ) ; while ( Wire . available ( ) == 0 ) ; retVal = Wire . read ( ) ; return retVal ; }
Method: readOneByte
In: register to read
Out: data read from i2c
Description: reads one byte register from i2c
Method : readOneByte In : register to read Out : data read from i2c Description : reads one byte register from i2c