Guest User

Untitled

a guest
Mar 23rd, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1.             port = new SerialPort("COM7", 250000, Parity.None, 8, StopBits.One);
  2.             port.Handshake = Handshake.None;
  3.             port.Open();
  4.  
  5.             byte[] a = new byte[4] { 50, 51, 52, 53 };
  6.             byte[] c = new byte[4];
  7.  
  8.             port.Write(a, 0, 4);
  9.  
  10.             port.Read(c, 0, 4);
  11.  
  12.             for (int i = 0; i < 4; i++)
  13.             {
  14.                 Console.WriteLine(c[i]);
  15.             }
  16.  
  17.             Console.WriteLine("ok");
Advertisement
Add Comment
Please, Sign In to add comment