Hey,
Last year I picked up an Uno for a lockdown project. That went well and I've just bought a Raspberry Pi Pico for more speed and memory. However the Serial communication code that worked fine with Uno/C# comms isn't working with Pico/C# comms.
Using Serial.write on the Pico will cause the output to appear in the Arduino IDE's Serial Monitor but C# won't find anything to read.
For a test I've stripped it down to this:
void setup() {
Serial.begin(9600);
while (!Serial) { }
}
void loop() {
Serial.write( "Hello World\n" );
delay( 1000 );
}
As expected, the Serial Monitor is full of "Hello World", but this test C# snippet gets nothing.
SerialPort serialPort = new SerialPort( "COM6", 9600 );
serialPort.Open();
while ( true )
{
Console.WriteLine( $"Received: {serialPort.ReadExisting()}" );
Thread.Sleep(1000);
}
Note: I do not have the Serial Monitor and the C# app trying to connect at the same time as I know that will cause problems.
Does the Pico do something different with its Serial output that the monitor is aware of but I'm missing in my SerialPort setup in C#?
Any help would be much appreciated.