I use NP2 and VS2010 and this code for a simple serial communication among NP2 and Computer.
D0 and D1.
if I use this code:
SerialPort UART1 = new SerialPort(SerialPorts.COM1, 9600, Parity.None, 8, StopBits.One);
String Messagge = "Bye!";
Byte[] bytesMessage = Encoding.UTF8.GetBytes(Messagge);
UART1.Open();
while (true)
{
UART1.Write(bytesMessage, 0, bytesMessage.Length);
Thread.Sleep(1000);
}
UART1.Close();
I obtain:
!!ye!ye!!ye!yyyye!yye!e!Bye!!!ye!ye!ee!e!e!ee!e!e!e!e!e!Bye!Bye!Bye!Bye!!!ye!ye!!ye!!ye!!ye!!!ye!ye!!ye!!ye!Bye!Bye!Bye!Bye!
what is the problem in my code?