Well I said I only compiled it not that I ran it! haha! OK Now I have run it. You also need to do a serialPort.Open() on the serial port. So change main to this:
public static void Main(){ // write your code here SerialPort serialPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One); serialPort.Open(); byte[] outBuffer = System.Text.Encoding.UTF8.GetBytes("Hello World!rn"); serialPort.Write(outBuffer, 0, outBuffer.Length); serialPort.Dispose(); //keeps the emulator running to see results Thread.Sleep(Timeout.Infinite);}which came from running code, and I can see the output from the serial port.
And I guess you've stumbled across one of the little joys: you got an ArgumentException, but the arguments (to Write) were fine, it was just the state of the object was unexpected.
Hi all.
I'm using GSMshield Icomsat v1.1 with netduinoplus. I need to communicate with the GSmShield through the serial port. on your post above, I just dont see declaration about netduino digital Pins as Rx/Tx. can anybody explain?
thx