コード例 #1
0
 private void InitializePortReader()
 {
     try
     {
         pr            = new PortReader();
         pr.NewString += new EventHandler <PortEventArgs>(pr_NewString);
         Thread t = new Thread(pr.loop);
         //t.IsBackground = true;
         t.Start();
     }
     catch (Exception e)
     {
         MessageBox.Show("Could not connect to Arduino");
         pr = null;
     }
 }