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

Sending data to Netduino through serial port

RS232 Netduino USB-RS232 TTL

  • Please log in to reply
2 replies to this topic

#1 Prashant

Prashant

    New Member

  • Members
  • Pip
  • 8 posts

Posted 13 November 2013 - 03:20 AM

Hi,

 

I am using the below code in my console application to send data to my Netduino through serial port:

static SerialPort port = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);port.Open();string message = "ON";byte[] bytes = Encoding.UTF8.GetBytes(message);port.Write(bytes, 0, bytes.Length);port.Close();

The above code is working fine but only once i.e. when I send a string to my Netduino for the first time it turns on the onboard LED but when I try to send the string for the second time it does nothing!!

 

Also if I try Putty or TeraTerm to send string to my Netduino it works just fine. Is it something I am missing

 

I am using Hari's code on my Netduino: http://forums.netdui...rt-code-review/



#2 Dr Who

Dr Who

    Advanced Member

  • Members
  • PipPipPip
  • 261 posts
  • LocationNYC

Posted 13 November 2013 - 06:23 PM

Hi,

 

I am using the below code in my console application to send data to my Netduino through serial port:

static SerialPort port = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);port.Open();string message = "ON";byte[] bytes = Encoding.UTF8.GetBytes(message);port.Write(bytes, 0, bytes.Length);port.Close();

The above code is working fine but only once i.e. when I send a string to my Netduino for the first time it turns on the onboard LED but when I try to send the string for the second time it does nothing!!

 

Also if I try Putty or TeraTerm to send string to my Netduino it works just fine. Is it something I am missing

 

I am using Hari's code on my Netduino: http://forums.netdui...rt-code-review/

 

Hello!

Are you sure about that link? It sends me back to the front of the forums.



Doctor Who
"This signature does not exist!"

#3 Prashant

Prashant

    New Member

  • Members
  • Pip
  • 8 posts

Posted 14 November 2013 - 05:39 AM

Thanks Dr Who!! I have updated the link now..







Also tagged with one or more of these keywords: RS232, Netduino, USB-RS232 TTL

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.