public void Stop()
 {
     if (patternAnimator != null && patternAnimator.IsBusy)
     {
         Led.Stop();
         patternAnimator.CancelAsync();
     }
 }
Exemplo n.º 2
0
        void OnNetworkConnected(object sender, EventArgs e)
        {
            Debug.Print("InitializeNetwork()");

            mapleServer.Start("CarHost", Initializer.CurrentNetworkInterface.IPAddress);

            ledRed.Stop();
            ledGreen.IsOn = true;
            tankController.Stop();
        }
Exemplo n.º 3
0
        void TestLed()
        {
            while (true)
            {
                Console.WriteLine("Turning on and off each led for 1 second");
                for (int i = 0; i < 2; i++)
                {
                    led.IsOn = true;
                    Thread.Sleep(1000);
                    led.IsOn = false;
                    Thread.Sleep(1000);
                }

                Console.WriteLine("Blinking the LED for a bit.");
                led.StartBlink();
                Thread.Sleep(3000);
                led.Stop();
            }
        }
Exemplo n.º 4
0
        /// <summary>
        ///  Method for led feature
        /// </summary>
        private void LedSample()
        {
            bool value;
            // Checks the led feature is supported in this device
            var result = Information.TryGetValue <bool>("http://tizen.org/feature/led", out value);
            var t      = Task.Run(async delegate
            {
                await Task.Delay(300);
                return;
            });

            if (!result || !value)
            {
                // Led is not supported
                this.Navigation.PushAsync(new SimpleResult("Wearable doesn't support led feature"));
                return;
            }

            try
            {
                // Plays the LED that is located at the front of the device
                Led.Play(500, 200, Tizen.Common.Color.FromRgba(255, 255, 255, 1));
                // Wait 300ms
                t.Wait();
                // Stops the LED
                Led.Stop();

                // Operations are succeed
                this.Navigation.PushAsync(new SimpleResult("Succeed: Led"));
            }
            catch (Exception e)
            {
                // Operations are failed
                this.Navigation.PushAsync(new SimpleResult("Failed: Led\n" + e.Message));
            }
        }