Sending string to microcontrol through Serial communication?

HI,

My requirement is:

I need a pass a string from Visual basic to Microcontroller through serial communication.

My Visual basic program is working fine.

But my microcontroller program written in C is giving me some problem.

And one more thing is i am able to pass a single character. When i am going for string only i am facing issues.

Can anyone pls. send me the sample code (c code for microcontroller to receive a string)?

Thanks in advance.

This sounds like an issue due to the different way strings are held in VB and C / C++.
In both VB and C / C++ a string can be imagined as a list of single characters held sequentially, however it is how the length of the string is determined that differs.
In VB the zeroth character is actualy a number containing the length, but in C / C++ the string end is denoted by a null.
Change your VB to explicity send a count and then a sequence of single characters (which you say you can do), then change the C to build a string from that sequence.
Topic archived. No new replies allowed.