Go Down

Topic: Problems in TX/RX data between C# and Arduino (Read 9004 times) previous topic - next topic

reynal74

by the way, how would you approach garbage packet "<N0TRaSH" or missing ">". I know my the code will hang in those two cases.

PaulS

The art of getting good answers lies in asking good questions.

reynal74

In order to make my program more fault tolerant, should i do it in both?

PaulS

Quote
In order to make my program more fault tolerant, should i do it in both?

Yes. You are sending data to the Arduino. It needs to check the integrity of the data it received, before doing something with it.

You are sending data from the Arduino. The C# application should check the integrity of the data it received, before doing something with it.
The art of getting good answers lies in asking good questions.

reynal74


Graynomad

#35
Dec 19, 2010, 03:11 am Last Edit: Dec 19, 2010, 03:13 am by graynomad Reason: 1
Quote
Quote:
I just needed to set N = 0 before the while loop.
Ah, yes. The little things that trip you up.


Reynal had

Code: [Select]
while(N <= atoiHolder) {
 // do stuff
   N = N + 1; //Incrementing the N-Domain
}


which worked the first time but N was never reset to 0 so the while test failed on subsequent iterations.

Oops, just realised I responded to a post on page 2.

______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

reynal74

I'm an total amateur coding hehe. If it wasn't for the help I wouldn't be able get nowhere. I just got caught up in final exams  :'( , I'm dying to go back to Arduino. One more week, one more week.

Go Up