private void btnAutoFixAngle_Click(object sender, RoutedEventArgs e) { int angle = 0; try { angle = int.Parse(txtFixAngle.Text.Trim()); if ((angle < 0) || (angle > 180)) { UpdateInfo("輸入角度不正確", MyUtil.UTIL.InfoType.error); return; } } catch (Exception) { UpdateInfo("輸入角度不正確", MyUtil.UTIL.InfoType.error); return; } byte id = (byte)activeServo; if (UBT.V2_SetAngle(id, (byte)angle, 0)) { UBT.V2_MoveServo(id, (byte)angle, 50); } UBT.LockServo(id, true); UpdateActiveServo(); }