Hello. First of all sorry for my english.
I wrote a code for my arduino pro micro to communicate with c# application.
The arduino code:
void setup() {
Serial.begin(9600);
while(!Serial);
}
void loop()
{
Serial.println("Test message.");
delay(400);
}
The c# code:
static void Main(string[] args)
{
SerialPort serialPort = new SerialPort();
serialPort.BaudRate = 9600;
serialPort.PortName = "COM7";
serialPort.Open();
while (true)
{
string data = serialPort.ReadExisting();
Console.WriteLine(data);
}
}
The problem is i cant take the messages from c# application. When i use the arduino serial monitor it works very well but on c# its not work. can anyone help please.