Esempio n. 1
0
 public IEnumerable <string> GetPorts()
 {
     try
     {
         ArduinoConnector com = new ArduinoConnector();
         return(com.PortNames());
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            ArduinoConnector com = new ArduinoConnector();

            foreach (var item in com.PortNames())
            {
                Console.WriteLine(item);
            }
            Console.WriteLine(com.PortConnect("COM1"));
            Console.WriteLine(com.WriteToPort("COM1", "la vai..."));
            Console.WriteLine(com.ReadFromPort("COM1"));
            Console.ReadKey();
        }