using System;
using System.IO;
using System.IO.Ports;
using System.Text;
namespace MyProgram
{
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("Opening serial port");
SerialPort sp = new SerialPort("COM3", 115200); //порт и скорость обмена
sp.Open();
WriteLine("Hello!");
while (sp.BytesToRead() <= 0)
{
System.Threading.Thread.Sleep(1000);
}
Console.WriteLine(sp.ReadLine());
sp.Close();
}
}
}