Example #1
0
        public void LedSet(ledState state)
        {
            try
            {
                switch (state)
                {
                case ledState.IdentificationFail:
                    Btn_RedLedON_Click(new object(), new EventArgs());
                    break;

                case ledState.IdentificationSuccess:
                    Btn_GreenLedON_Click(new object(), new EventArgs());
                    break;

                case ledState.ServerFailConnection:
                    for (int i = 0; i < 3; i++)
                    {
                        Btn_RedLedON_Click(new object(), new EventArgs());
                        Thread.Sleep(500);
                        Btn_AllLedOFF_Click(new object(), new EventArgs());
                        Thread.Sleep(500);
                    }
                    break;
                }
                if (state != ledState.Ready)
                {
                    Thread.Sleep(5000);
                }
                Btn_BlueLedON_Click(new object(), new EventArgs());
            }
            catch (Exception)
            { }
        }
 /// <summary>
 /// Create a RGB LED Control.  Supports On/off and blink manager
 /// </summary>
 /// <param name="red">From the SecretLabs.NETMF.Hardware.NetduinoPlus.Pins namespace</param>
 /// <param name="green">From the SecretLabs.NETMF.Hardware.NetduinoPlus.Pins namespace</param>
 /// <param name="blue">From the SecretLabs.NETMF.Hardware.NetduinoPlus.Pins namespace</param>
 /// <param name="name">Unique identifying name for command and control</param>
 public RgbLed(Cpu.Pin red, Cpu.Pin green, Cpu.Pin blue, string name)
     : base(name, "rgbled")
 {
     Cpu.Pin[] ledPins = new Cpu.Pin[] { red, green, blue };
     for (int i = 0; i < 3; i++) {
         ls[i] = new ledState();
         ls[i].led = new OutputPort(ledPins[i], false);
     }
 }
Example #3
0
 public RgbLed(Cpu.Pin red, Cpu.Pin green, Cpu.Pin blue, string name)
     : base(name, ActuatorType.RgbLed)
 {
     Cpu.Pin[] ledPins = new Cpu.Pin[] { red, green, blue };
     for (int i = 0; i < 3; i++)
     {
         ls[i]     = new ledState();
         ls[i].led = new OutputPort(ledPins[i], false);
     }
 }
Example #4
0
        public LBLed()
        {
            InitializeComponent();

            this.Size          = new Size(80, 80);
            this.ledColor      = Color.Red;
            this.ledOffColor   = Color.Gray;
            this.state         = LBLed.ledState.Blink;
            this.style         = LBLed.LedStyle.Circular;
            this.blinkIsOn     = false;
            this.ledSize       = new SizeF(50F, 50F);
            this.labelPosition = LedLabelPosition.Top;

            this.blinkIsOn         = true;
            this.tmrBlink.Interval = this.BlinkInterval;
            this.tmrBlink.Start();
        }