I want to send sensor data from the Arduino Nano 33 BLE to the PC by serial port. I also want to send commands from the PC to the Arduino Nano 33 BLE. It works ok if I use the IDE Serial Monitor for send and receive, but when I use my C# Windows app it doesn't work. It is really a basic app with just serialPort.WriteLine("test") but data is not sent to the arduino and I have a timeout. Why does it work with arduino IDE and not with a C# app? Anyone had similar issue?
EDIT: for my test I used the ReadASCIIString arduino example.
On the C# side it is quite simple, just:
SerialPort serialPort = new SerialPort("COM17", 57600);
serialPort.ReadTimeout = 4000;
serialPort.WriteTimeout = 4000;
serialPort.DataReceived += SerialPort_DataReceived;
serialPort.Open();
if (serialPort.IsOpen)
{
Debug.Print("COM port open");
}
I get the "COM port open" message so the port exists and it is open but it looks like nothing arrives to the arduino nano 33 BLE and I get no reply. This works like a charm with a good old arduino nano.