i have a program in C#. and i want to print out what the program gets from serial.
class Serial
{
public static void Main()
{
byte[] buffer = new byte[256];
using (SerialPort sp = new SerialPort("COM2", 6200))
{
sp.Open();
//read directly
sp.Read(buffer, 0, (int)buffer.Length);
//read using a Stream
sp.BaseStream.Read(buffer, 0, (int)buffer.Length);
Console.WriteLine(buffer);
}
}
}
The program writes out System.byte[] and then quits.
Similar to what SLaks said, this would be the fix: