Hope everything is fine.
I try to geht values of an optical encoder, sent via arduino by serial port to my C# Program...
My problem is, often I got salad .. The EventHandler is firing in the middle of a message and I get many wrong values.
this is my event handler:
public void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)
string indata = port.ReadExisting();
whats the best option to send (i am very flexible in what i am sending on the serial port)
and whats a good and performing method to receive it without having salad for breakfest?
salad means.. only some chars, sometimes also charts from the next message...
Has anybody already done sth like this?
EDIT: Found it! I used readline command, then it was working more well!
modified 21-Oct-22 8:12am.