示例#1
0
        static void Main(string[] args)
        {
            SerialProtocol          p     = new SerialProtocol();
            ControlCommandStructure cCmd  = new ControlCommandStructure();
            RealtimeDataStructure   rData = rtD;
            String select;

            byte[] byteRead = new byte[100];
            int    roll, pitch, yaw;

            while (true)
            {
                Console.WriteLine("Input what you want");
                Console.WriteLine("1. Check the gimbal angle");
                Console.WriteLine("2. Set the gimbal angle");
                Console.WriteLine("3. Exit");
                switch (select = Console.ReadLine())
                {
                case "1":
                    getAngle();
                    break;

                case "2":
                    Console.WriteLine("Give the angle value.");
                    roll  = Convert.ToInt32(Console.ReadLine());
                    pitch = Convert.ToInt32(Console.ReadLine());
                    yaw   = Convert.ToInt32(Console.ReadLine());
                    setAngle(roll, pitch, yaw, ref cCmd);
                    break;

                case "3":
                    return;

                    break;
                }
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            SerialProtocol p = new SerialProtocol();
            ControlCommandStructure cCmd = new ControlCommandStructure();
            RealtimeDataStructure rData = rtD;
            String select;
            byte[] byteRead = new byte[100];
            int roll, pitch, yaw;
  
            while (true)
            {
                Console.WriteLine("Input what you want");
                Console.WriteLine("1. Check the gimbal angle");
                Console.WriteLine("2. Set the gimbal angle");
                Console.WriteLine("3. Exit");
                switch (select=Console.ReadLine())
                {
                    case "1":
                        getAngle();
                        break;

                    case "2":
                    Console.WriteLine("Give the angle value.");
                    roll = Convert.ToInt32(Console.ReadLine());
                    pitch = Convert.ToInt32(Console.ReadLine());
                    yaw = Convert.ToInt32(Console.ReadLine());
                    setAngle(roll, pitch, yaw, ref cCmd);
                    break;

                    case "3":
                        return;
                        break;

                    


                }
            }
            

        }