This function gets present position (joint) of DYNAMIXEL.
getLastErrorCode()
to see if this value indicates an error. const int DXL_DIR_PIN = 2;
Dynamixel2Arduino dxl(Serial1, DXL_DIR_PIN);
Serial.print(dxl.getPresentPosition(1)); //use default encoder value
Serial.print(dxl.getPresentPosition(1, UNIT_DEGREE)); //use angle in degree