public ResetMotorPosition ( Motor motor, bool relative, bool waitReply ) : bool | ||
motor | Motor | Motor to reset. |
relative | bool | Specifies if relative (to last movement) or absolute motor's /// position should reset. |
waitReply | bool | Wait reply from NXT (safer option) or not (faster option). |
return | bool |
public bool ResetMotorPosition( Motor motor, bool relative, bool waitReply )
{
byte[] command = new byte[4];
// prepare message
command[0] = (byte) ( ( waitReply ) ? NXTCommandType.DirectCommand : NXTCommandType.DirectCommandWithoutReply );
command[1] = (byte) NXTDirectCommand.ResetMotorPosition;
command[2] = (byte) motor;
command[3] = (byte) ( ( relative ) ? 0xFF : 0x00 ); // reset relative or absolute position
return SendCommand( command, new byte[3] );
}
NXTBrick::ResetMotorPosition ( Motor motor, bool relative ) : bool |