static void Main(string[] args) { program(); Console.WriteLine("This program contains a software component made available under the GNU Lesser General Public License. The source code of this component is available here:"); Console.WriteLine("https://github.com/brand7n/lpc21isp"); // Create new instance of the FTDI device class FTDI myFtdiDevice = new FTDI(); attention(); Console.WriteLine("ATTEMPTING TO CONNECT..."); subdue(); while (true) { try { open(myFtdiDevice); Thread.Sleep(1000); } catch (Exception ex) { Console.WriteLine(ex.Message); attention(); Console.WriteLine("DISCONNECTED. RESTART OR REATTACH DEVICE."); subdue(); Console.WriteLine(ex.Message); } finally { myFtdiDevice.CyclePort(); } } }