コード例 #1
0
        public ActionResult <string> index()
        {
            Bus        bus        = new Bus(new KnxIpTunnelingConnectorParameters("192.168.1.10", 0x0e57, false));
            Chenillard chenillard = new Chenillard(bus);

            return("connected : type '/start' to start the chenillard and '/stop' to stop it");
        }
コード例 #2
0
        static void Main(string[] args)
        {
            //Chenillard Console
            int     speedCmd     = 500;
            string  LED          = null;
            string  command      = null;
            Boolean loopContinue = true;

            Console.WriteLine($@"=============***>>>>>>>                            <<<<<<<<<<<******==========
                    Welcome to the Chenillard console ");
            Chenillard chenillardContol = new Chenillard();

            while (true && loopContinue == true)
            {
                Console.WriteLine("Start the chenillard by pressing [V], stop chenillard with [C], select your speed with [S]. To quit, press [Q]. To change Order, press [O]. Actual speed : " + chenillardContol.speed + "ms");
                command = Console.ReadLine();
                switch (command)
                {
                case "V":
                    chenillardContol.startChenillard();
                    break;

                case "C":
                    chenillardContol.stopChenillard();
                    break;

                case "S":
                    Console.WriteLine("Choose your Speed : ");
                    speedCmd = Convert.ToInt32(Console.ReadLine());
                    chenillardContol.speed = speedCmd;
                    break;

                case "O":
                    Console.WriteLine("Choose Order :");
                    Console.WriteLine("LED1 :");
                    LED = Console.ReadLine();
                    chenillardContol.Led1 = LED;
                    Console.WriteLine("LED2 :");
                    LED = Console.ReadLine();
                    chenillardContol.Led2 = LED;
                    Console.WriteLine("LED3 :");
                    LED = Console.ReadLine();
                    chenillardContol.Led3 = LED;
                    Console.WriteLine("LED4 :");
                    LED = Console.ReadLine();
                    chenillardContol.Led4 = LED;

                    chenillardContol.changeOrder();
                    break;

                case "Q":
                    Console.WriteLine("Exiting..");
                    loopContinue = false;
                    break;
                }
            }

            Console.WriteLine("End... ");
            Console.ReadLine();
        }