lib/Seeed_Arduino_AS5600/AS5600.cpp
/*******************************************************
  Method: setMaxAngle
  In: new maximum angle to set OR none
  Out: value of max angle register
  Description: sets a value in maximum angle register.
  If no value is provided, method will read position of
  magnet.  Setting this register zeros out max position
  register.
*******************************************************/
setMaxAngle
In: new maximum angle to set OR none
Out: value of max angle register
Description: sets a value in maximum angle register.
If no value is provided, method will read position of
magnet.  Setting this register zeros out max position
register.
setMaxAngle In : new maximum angle to set OR none Out : value of max angle register Description : sets a value in maximum angle register . If no value is provided method will read position of magnet . Setting this register zeros out max position register .
word AMS_5600::setMaxAngle(word newMaxAngle)
{
  word retVal;
  if (newMaxAngle == -1)
  {
    _maxAngle = getRawAngle();
  }
  else
    _maxAngle = newMaxAngle;
  writeOneByte(_mang_hi, highByte(_maxAngle));
  delay(2);
  writeOneByte(_mang_lo, lowByte(_maxAngle));
  delay(2);
  retVal = readTwoBytes(_mang_hi, _mang_lo);
  return retVal;
}
word AMS_5600 :: setMaxAngle ( word newMaxAngle ) { word retVal ; if ( newMaxAngle == -1 ) { _maxAngle = getRawAngle ( ) ; } else _maxAngle = newMaxAngle ; writeOneByte ( _mang_hi , highByte ( _maxAngle ) ) ; delay ( 2 ) ; writeOneByte ( _mang_lo , lowByte ( _maxAngle ) ) ; delay ( 2 ) ; retVal = readTwoBytes ( _mang_hi , _mang_lo ) ; return retVal ; }
Method: setMaxAngle
In: new maximum angle to set OR none
Out: value of max angle register
Description: sets a value in maximum angle register.
Method : setMaxAngle In : new maximum angle to set OR none Out : value of max angle register Description : sets a value in maximum angle register .