Пример #1
0
        public static Boolean yaw(int yaw)
        {
            Boolean result = false;

            if (yaw < 1000 || yaw > 2000)
            {
                return(result);
            }
            int[] data = { channelsActualValues[0], channelsActualValues[1], yaw, channelsActualValues[3] };
            channelsActualValues[2] = yaw;
            Console.WriteLine(string.Join(",", data));
            if (!MultiWiiFunctions.mspSetRawRC(data).Equals(new byte[0]))
            {
                result = true;
            }
            return(result);
        }
Пример #2
0
        public static Boolean pitch(int pitch)
        {
            Boolean result = false;

            if (pitch < 1000 || pitch > 2000)
            {
                return(result);
            }
            int[] data = { channelsActualValues[0], pitch, channelsActualValues[2], channelsActualValues[3] };
            channelsActualValues[1] = pitch;
            Console.WriteLine(string.Join(",", data));
            if (!MultiWiiFunctions.mspSetRawRC(data).Equals(new byte[0]))
            {
                result = true;
            }
            return(result);
        }
Пример #3
0
        public static Boolean roll(int roll)
        {
            Boolean result = false;

            if (roll < 1000 || roll > 2000)
            {
                return(result);
            }
            int[] data = { roll, channelsActualValues[1], channelsActualValues[2], channelsActualValues[3] };
            channelsActualValues[0] = roll;
            Console.WriteLine(string.Join(",", data));
            if (!MultiWiiFunctions.mspSetRawRC(data).Equals(new byte[0]))
            {
                result = true;
            }
            return(result);
        }
Пример #4
0
        public static Boolean disarm()
        {
            Boolean result = false;

            int[] data = { 1500, 1500, 1500, 1000, 1000 };
            channelsActualValues[0] = 1500;
            channelsActualValues[1] = 1500;
            channelsActualValues[2] = 1500;
            channelsActualValues[3] = 1000;
            channelsActualValues[4] = 1000;
            Console.WriteLine(string.Join(",", data));
            if (!MultiWiiFunctions.mspSetRawRC(data).Equals(new byte[0]))
            {
                result = true;
            }
            return(result);
        }
Пример #5
0
        public static Boolean throttle(int throttle)
        {
            Boolean result = false;

            if (throttle < 1000 || throttle > 2000)
            {
                return(result);
            }
            if (throttle == 1000)
            {
                channelsActualValues[0] = 1500;
                channelsActualValues[1] = 1500;
                channelsActualValues[2] = 1500;
            }
            int[] data = { channelsActualValues[0], channelsActualValues[1], channelsActualValues[2], throttle };
            channelsActualValues[3] = throttle;
            Console.WriteLine(string.Join(",", data));
            if (!MultiWiiFunctions.mspSetRawRC(data).Equals(new byte[0]))
            {
                result = true;
            }
            return(result);
        }