static void Main(string[] args) { int speedCmd = 500; string LED = null; string command = null; Boolean loopContinue = true; Console.WriteLine("Connected !"); while (true && loopContinue == true) { Console.WriteLine($@"Welcome ! Choose your Action : [V] : Start chenillard [C] : stop chenillard [S] : Choose Speed [O] : Change Order [Q] : Quit Actual speed : " + chenillard.speed); command = Console.ReadLine(); switch (command) { case "V": chenillard.StartChenillard(); break; case "C": chenillard.StopChenillard(); break; case "S": Console.WriteLine("Choose Your Speed in ms (minimum 500) :"); speedCmd = Convert.ToInt32(Console.ReadLine()); chenillard.speed = speedCmd; break; case "O": Console.WriteLine($@"Actual Order: [LED1] : {chenillard.Led1} [LED2] : {chenillard.Led2} [LED3] : {chenillard.Led3} [LED4] : {chenillard.Led4}"); Console.WriteLine("Choose Order by adding Led Addresses X/X/X Type Q to Cancel : "); Console.WriteLine("LED n1 :"); LED = Console.ReadLine(); if (LED == "Q") { break; } chenillard.Led1 = LED; Console.WriteLine("LED n2 :"); LED = Console.ReadLine(); if (LED == "Q") { break; } chenillard.Led2 = LED; Console.WriteLine("LED n3 :"); LED = Console.ReadLine(); chenillard.Led3 = LED; if (LED == "Q") { break; } Console.WriteLine("LED n4 :"); LED = Console.ReadLine(); chenillard.Led4 = LED; if (LED == "Q") { break; } chenillard.changeOrder(); break; case "Q": Console.WriteLine("Exiting...."); loopContinue = false; break; } } Console.WriteLine("End... Press a Key to disconnect..."); Console.ReadLine(); Client.Disconnect(); Console.WriteLine("Disconnected !"); Console.ReadLine(); }