Beispiel #1
0
        public static Color GetColor(string Header)
        {
            Console.WriteLine(Header);
            ParameterMaster pm = new ParameterMaster(new List <string> {
                "r", "g", "b"
            });

            return(new Color(pm.GetInt("r"), pm.GetInt("g"), pm.GetInt("b")));
        }
Beispiel #2
0
        static void BasicFunc()
        {
            ILightHolder lh;

            LogitechGSDK.LogiLedInitWithName("SetTargetZone Sample C#");

            if (true)
            {
                lh = new LightHolderSparta();
            }
            else
            {
                lh = new LightHolder();
            }

            List <string> menu = new List <string>
            {
                "r - random show",
                "l - later start random show",
                "b - blink",
                "s - set color",
                "p - pulse"
            };


            foreach (string s in menu)
            {
                Console.WriteLine(s);
            }


            string answerA = Console.ReadLine();


            if (answerA.isFirstKey('r'))
            {
                lh.RandomShowAsync(300, lh.BaseColors);
            }

            if (answerA.isFirstKey('l'))
            {
                Console.WriteLine("When start?");

                ParameterMaster pm = new ParameterMaster(new List <string> {
                    "Hour", "Minute"
                });

                PauseTo(pm.GetInt("Hour"), pm.GetInt("Minute"));
                lh.RandomShowAsync(300, lh.BaseColors);
            }

            if (answerA.isFirstKey('b'))
            {
                List <Color> c = new List <Color>();
                c.Add(ParameterMaster.GetColor("Insert color!"));
                c.Add(new Color(0, 0, 0));

                int gap = 400;

                lh.BlinkListAsync(c, gap);
            }

            if (answerA.isFirstKey('s'))
            {
                lh.ActiveColor = ParameterMaster.GetColor("Insert color!");
            }

            if (answerA.isFirstKey('p'))
            {
                ParameterMaster pm = new ParameterMaster(new List <string> {
                    "int"
                });
                lh.PulseAsync(ParameterMaster.GetColor("Insert color!"), pm.GetInt("int"));
                Console.ReadLine();
            }
        }