how to make arduino to receive line by line from c#

I have c# app. that open *.txt file and read the first line then send it to arduino that receive line and make process on it , but the arduino receive just one line and then stops or repeating the line but doesnot receive a new one … how can I make c# send line by line and make arduino receive line that been sent from c# and make process on it then forget the last line then receive a new one to repeat the process on it

Since you have not posted any code I can't offer much in the way of advice.

A common problem is that PC programmers open and close serial ports between tasks. That is not appropriate with an Arduino because opening the port causes the Arduino to reset. Your PC program should open the port and keep it open until you have finished using the Arduino.


i am a newbie in arduino… can teach me on how to send the text file from pc using c# to arduino?

i am search through google…but it seem likes complicated. can guide me?thanks.

the content in my file is a sensor data:

how do i send this txt file from c# and make arduino receive it line , and make process on that line, then receive another line and so on until finish the whole file .

I don't have Windows and I know very little about C#

This demo illustrates how to send stuff to an Arduino using Python - the general principles will be the same in any language.

The Python program should run under Windows if you put in the correct COM port reference.

You can also communicate with the Arduino program just using the Arduino IDE.

As a start I suggest you leave my Arduino code untouched and write a C# program that does the same thing as the Python program. That way you can be confident that the problems (if any) are in your PC program.