lib/Seeed_Arduino_AS5600/AS5600.cpp
/*******************************************************
  Method: setEndtPosition
  In: new end angle position
  Out: value of end position register
  Description: sets a value in end position register.
  If no value is provided, method will read position of
  magnet.  
*******************************************************/
setEndtPosition
In: new end angle position
Out: value of end position register
Description: sets a value in end position register.
If no value is provided, method will read position of
magnet.
setEndtPosition In : new end angle position Out : value of end position register Description : sets a value in end position register . If no value is provided method will read position of magnet .
word AMS_5600::setEndPosition(word endAngle)
{
  if (endAngle == -1)
    _rawEndAngle = getRawAngle();
  else
    _rawEndAngle = endAngle;
  writeOneByte(_mpos_hi, highByte(_rawEndAngle));
  delay(2);
  writeOneByte(_mpos_lo, lowByte(_rawEndAngle));
  delay(2);
  _mPosition = readTwoBytes(_mpos_hi, _mpos_lo);
  return (_mPosition);
}
word AMS_5600 :: setEndPosition ( word endAngle ) { if ( endAngle == -1 ) _rawEndAngle = getRawAngle ( ) ; else _rawEndAngle = endAngle ; writeOneByte ( _mpos_hi , highByte ( _rawEndAngle ) ) ; delay ( 2 ) ; writeOneByte ( _mpos_lo , lowByte ( _rawEndAngle ) ) ; delay ( 2 ) ; _mPosition = readTwoBytes ( _mpos_hi , _mpos_lo ) ; return ( _mPosition ) ; }
Method: setEndtPosition
In: new end angle position
Out: value of end position register
Description: sets a value in end position register.
Method : setEndtPosition In : new end angle position Out : value of end position register Description : sets a value in end position register .