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 }); }
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); } } } }