src/AS5600.cpp
word AMS_5600::setMaxAngle(word newMaxAngle)
{
  word _maxAngle;
  if (newMaxAngle == -1)
    _maxAngle = getRawAngle();
  else
    _maxAngle = newMaxAngle;

  writeOneByte(_addr_mang, highByte(_maxAngle));
  delay(2);
  writeOneByte(_addr_mang+1, lowByte(_maxAngle));
  delay(2);

  word retVal = readTwoBytesSeparately(_addr_mang);
  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.
  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 _maxAngle;
  if (newMaxAngle == -1)
    _maxAngle = getRawAngle();
  else
    _maxAngle = newMaxAngle;
  writeOneByte(_addr_mang, highByte(_maxAngle));
  delay(2);
  writeOneByte(_addr_mang+1, lowByte(_maxAngle));
  delay(2);
  word retVal = readTwoBytesSeparately(_addr_mang);
  return retVal;
}
word AMS_5600 :: setMaxAngle ( word newMaxAngle ) { word _maxAngle ; if ( newMaxAngle == -1 ) _maxAngle = getRawAngle ( ) ; else _maxAngle = newMaxAngle ; writeOneByte ( _addr_mang , highByte ( _maxAngle ) ) ; delay ( 2 ) ; writeOneByte ( _addr_mang + 1 , lowByte ( _maxAngle ) ) ; delay ( 2 ) ; word retVal = readTwoBytesSeparately ( _addr_mang ) ; 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 .