lib/Seeed_Arduino_AS5600/AS5600.cpp
/*******************************************************
  Method: detectMagnet
  In: none
  Out: 1 if magnet is detected, 0 if not
  Description: reads status register and examines the 
  MH bit
*******************************************************/
detectMagnet
In: none
Out: 1 if magnet is detected, 0 if not
Description: reads status register and examines the
MH bit
detectMagnet In : none Out : 1 if magnet is detected 0 if not Description : reads status register and examines the MH bit
int AMS_5600::detectMagnet()
{
  int magStatus;
  int retVal = 0;
  magStatus = readOneByte(_stat);
  if (magStatus & 0x20)
    retVal = 1;
  return retVal;
}
int AMS_5600 :: detectMagnet ( ) { int magStatus ; int retVal = 0 ; magStatus = readOneByte ( _stat ) ; if ( magStatus & 0x20 ) retVal = 1 ; return retVal ; }
Method: detectMagnet
In: none
Out: 1 if magnet is detected, 0 if not
Description: reads status register and examines the
MH bit
Method : detectMagnet In : none Out : 1 if magnet is detected 0 if not Description : reads status register and examines the MH bit
/*0 0 MD ML MH 0 0 0*/ /* MD high = magnet detected*/ /* ML high = AGC Maximum overflow, magnet to weak*/ /* MH high = AGC minimum overflow, Magnet to strong*/