lib/Seeed_Arduino_AS5600/AS5600.cpp
/*******************************************************
  Method: setStartPosition
  In: new start angle position
  Out: value of start position register
  Description: sets a value in start position register.
  If no value is provided, method will read position of
  magnet.  
*******************************************************/
setStartPosition
In: new start angle position
Out: value of start position register
Description: sets a value in start position register.
If no value is provided, method will read position of
magnet.
setStartPosition In : new start angle position Out : value of start position register Description : sets a value in start position register . If no value is provided method will read position of magnet .
word AMS_5600::setStartPosition(word startAngle)
{
  if (startAngle == -1)
  {
    _rawStartAngle = getRawAngle();
  }
  else
    _rawStartAngle = startAngle;
  writeOneByte(_zpos_hi, highByte(_rawStartAngle));
  delay(2);
  writeOneByte(_zpos_lo, lowByte(_rawStartAngle));
  delay(2);
  _zPosition = readTwoBytes(_zpos_hi, _zpos_lo);
  return (_zPosition);
}
word AMS_5600 :: setStartPosition ( word startAngle ) { if ( startAngle == -1 ) { _rawStartAngle = getRawAngle ( ) ; } else _rawStartAngle = startAngle ; writeOneByte ( _zpos_hi , highByte ( _rawStartAngle ) ) ; delay ( 2 ) ; writeOneByte ( _zpos_lo , lowByte ( _rawStartAngle ) ) ; delay ( 2 ) ; _zPosition = readTwoBytes ( _zpos_hi , _zpos_lo ) ; return ( _zPosition ) ; }
Method: setStartPosition
In: new start angle position
Out: value of start position register
Description: sets a value in start position register.
Method : setStartPosition In : new start angle position Out : value of start position register Description : sets a value in start position register .