Pages: 1 2 [3]   Go Down
Author Topic: Problems in TX/RX data between C# and Arduino  (Read 4333 times)
0 Members and 1 Guest are viewing this topic.
New York, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Almighty Forum, help this newbie solve his problem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

If you think you have it, you don't. If you think you don't have it, you still don't.

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

On the Arduino or in C#?
Logged

New York, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Almighty Forum, help this newbie solve his problem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

If you think you have it, you don't. If you think you don't have it, you still don't.

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

New York, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Almighty Forum, help this newbie solve his problem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Got it, I'm right on it then.
Logged

If you think you have it, you don't. If you think you don't have it, you still don't.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8472
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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

« Last Edit: December 18, 2010, 09:13:08 pm by graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

New York, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Almighty Forum, help this newbie solve his problem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

If you think you have it, you don't. If you think you don't have it, you still don't.

Pages: 1 2 [3]   Go Up
Jump to: