コード例 #1
0
        void GestureController_GestureRecognized(object sender, GestureEventArgs e)
        {
            MyHttpClient request = new MyHttpClient();
            tblGestures.Text = e.GestureType.ToString();
            switch (e.GestureType)
            {

                case GestureType.JoinedHands:
                    //Debug.WriteLine("JH");
                    request.send_request("/dance");
                    Debug.WriteLine("Dance");
                    break;
                case GestureType.Menu:
                    Debug.WriteLine("Menu");
                    break;
                case GestureType.SwipeDown:
                    Debug.WriteLine("SD");
                    break;
                case GestureType.SwipeLeft:
                    Debug.WriteLine("Swipe Left!");
                    request.send_request("/left");
                    break;
                case GestureType.SwipeRight:
                    Debug.WriteLine("Swipe Right!");
                    request.send_request("/right");
                    //Debug.WriteLine("Going Right!");
                    break;
                case GestureType.SwipeUp:
                    Debug.WriteLine("Swipe Up!");
                    request.send_request("/up");
                    //Debug.WriteLine("Stay High All The Time!");
                    break;
                case GestureType.WaveLeft:
                    Debug.WriteLine("Wave Left!");
                    request.send_request("/animateLEDs");
                    break;
                case GestureType.WaveRight:
                    Debug.WriteLine("Going Down!");
                    request.send_request("/land");
                    //Debug.WriteLine("Au Revoir");
                    isRunning = false;
                    break;
                case GestureType.ZoomIn:
                    Debug.WriteLine("Zoom In");
                    request.send_request("/forward");
                    //Debug.WriteLine("Winter is Coming!");
                    break;
                case GestureType.ZoomOut:
                    Debug.WriteLine("Zoom Out");
                    request.send_request("/back");
                    //Debug.WriteLine("You know nothing Jon Snow.");
                    break;
                default:
                    break;
            }

        }
コード例 #2
0
        async private void OurFunction()
        {
            MyHttpClient request1 = new MyHttpClient();
            if(isRunning==false)
            {
                Debug.WriteLine("Taking Off!");
                request1.send_request("/takeoff");
                isRunning = true;
            }

            else
            {
                Debug.WriteLine("Stop!");
                request1.send_request("/stop");
            }


        }