コード例 #1
0
        private void SetServoAdjAngle()
        {
            UpdateInfo();
            if (activeServo > 0)
            {
                byte id = (byte)activeServo;

                int n = (int)sliderAdjValue.Value;
                if (n < 0)
                {
                    n += 65536;
                }
                UInt16 adjValue = (UInt16)n;

                if (!UBT.V2_SetAdjAngle(id, adjValue))
                {
                    UpdateInfo("Fail setting servo adjustment", UTIL.InfoType.error);
                    return;
                }
                if ((txtAdjPreview.Text == null) || (txtAdjPreview.Text.Trim() == ""))
                {
                    return;
                }
                byte angle = (byte)Convert.ToInt32(txtAdjPreview.Text, 10);
                UBT.V2_MoveServo(id, angle, 50);
            }
        }