I connected pin 5 on the serial cable to Gnd next to digital pin 13.
I tried connecting Pin 2 on the serial cable to D0 and Pin 3 to D1.
Hyperterminal is configured for 4800,8,N,1 with no handshaking.
Here is the code I am using. Stepping through the code the port.open works and the send returns 12 bytes written.
Am I doing anything wrong?
using System; using System.IO.Ports; using System.Text; // UTF Encoding using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino; namespace NetduinoApplication1 { public class Program { static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false); //instantiate the serial port connection static SerialPort serialPort = new SerialPort("COM1", 4800, Parity.None, 8, StopBits.One); public static void Main() { serialPort.Open(); if (serialPort.IsOpen) { Debug.Print("Serial Port is open."); } InterruptPort button = new InterruptPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth); button.OnInterrupt += new NativeEventHandler(button_OnInterrupt); Thread.Sleep(Timeout.Infinite); } static void button_OnInterrupt(uint data1, uint data2, DateTime time) { // Set the led led.Write(data2 == 0); // Encode to UTF8 UTF8Encoding enc = new UTF8Encoding(); // Encode Byte array string tempString = "Button Press"; byte[] tempData = enc.GetBytes(tempString); // Write to Serial Port int bytesWritten = serialPort.Write(tempData, 0, tempData.Length); Debug.Print("Bytes Written" + bytesWritten.ToString()); } } }