Hi everyeone,
Newbie here. I have a GPS I bought here: http://www.parallax.com/Store/Sensors/CompassGPS/tabid/173/CategoryID/48/List/0/SortField/0/Level/a/ProductID/645/Default.aspx and have connected it to my COM1 port on my FEZ domino board. Everything is connecting and running fine except the part where I’m getting errors trying to read from that com port. Here’s my code:
public static SerialPort c1;
static byte[] buffer = new byte[200];
public static void Main()
{
#region Read GPS
c1 = new SerialPort("COM1", 4800, Parity.None, 8, StopBits.One);
c1.ReadTimeout = 0;
c1.ErrorReceived += new SerialErrorReceivedEventHandler(c1_ErrorReceived);
c1.Open();
c1.DataReceived += new SerialDataReceivedEventHandler(c1_DataReceived);
#endregion
Thread.Sleep(-1);
}
static void c1_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
{
Debug.Print("COM Error: " + e.EventType.ToString());
}
static void c1_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
Debug.Print("somethin workeded");
}
I keep getting: “COM Error 1”. It keeps giving me those errors in spurts so I believe that the GPS is sending the data correctly. I’ve also been able to read all the data from my BASIC STAMP II controller with no problems. I guess my next question would be is the COM1 port TTL RS232 or is it EID RS232? I assumed it was the usual TTL but I’m not sure. Also, the error isn’t very detailed, is there more ways to trouble shoot this? Thanks!