Pages: [1]   Go Down
Author Topic: Serial Header and Footer?  (Read 618 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using Vixen, a program that I exporting serial output to arduino, but sometimes gets messed up. I've been told I need A header and footer and can do tht in vixen, but don't know how to incorporate that into my sketch. Here's the link to the sketc I'm using, all I've done is increased the channel amount and pins and all but it's the same principal. Any help is widely appreciated. I just need to know how I can add the header and footer into te sketch so that arduino can still read the serial data
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm afraid you are going to have to provide much more and detailed information then that. What is a header and footer? What information needs to be put into them?

Lefty
Logged

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

Quote
Here's the link to the sketc I'm using
Seems like you forgot something.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

*facepalm* sorry I might've foud what I need, with a forum post, but I just need arduino to be able to read the header a d footer to not get lost in te serial buffer
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just added In my void loop a

char *header="VIXEN_START"
char *footer="VIXEN_END"

Maybe it will work.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12568
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I kind of doubt that adding two initialised variables to your sketch will make any difference at all, assuming you fix the syntax so it compiles.

If I understood you correctly you have a program ("Vixen"?) on a PC which is sending serial data to an Arduino and you have configured Vixen to put some recogniseable strings at the start and end of each message. That would certainly make it easier for your Arduino to detect the boundaries of each message accurately. In this case your sketch would need to receive the character stream from Vixen and detect the start-of-message and end-of-message character sequences. It would use these to determine whether it was receiving a message, and whether the message was complete. Presumably you would want to buffer the content of the message until it was complete and then process it.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's exactly what I though I needed. Decided to try to increase baud rate on both things, and what do you know, it worked. I don't know why but thank for you help anyways. That's exactly what I needed, but it is working now.
Logged

Pages: [1]   Go Up
Jump to: