Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

serial communication in NP2


  • Please log in to reply
1 reply to this topic

#1 michel capua

michel capua

    Member

  • Members
  • PipPip
  • 26 posts

Posted 08 June 2013 - 08:19 AM

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?

 



#2 Bi Qin

Bi Qin

    Member

  • Members
  • PipPip
  • 23 posts

Posted 08 June 2013 - 03:26 PM

Try another uart tool on your pc...






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.