Exemple #1
0
 public MyColors()
 {
     Red = new MyColor("Red", new bool[3] { true, false, false });
     Orange = new MyColor("Orange", new bool[3] { true, true, false });
     Yellow = new MyColor("Yellow", new bool[3] { false, true, true });
     Green = new MyColor("Green", new bool[3] { false, true, false });
     Blue = new MyColor("Blue", new bool[3] { false, false, true });
     Purple = new MyColor("Purple", new bool[3] { true, false, true });
 }
Exemple #2
0
 public void ChangeColor(MyColor color)
 {
     if (!lockFlg)
     {
         for (var i = 0; i < 3; i++)
         {
             if (color.colorData[i] == true)
             {
                 ledPins[i].Write(GpioPinValue.High);
             }
             else
             {
                 ledPins[i].Write(GpioPinValue.Low);
             }
         }
     }
 }