Go Down

Topic: Communication btwn visual studios c++ and Arduino (Read 143 times) previous topic - next topic

andrewlenart

So I made a program on visual studios c++ to detect when my eyes are closed and when they're open. My goal is to turn a servo when they are closed, and not move it when they're open. Question is...how do I get the data that they're closed or open from visual studios, to my Arduino to turn the servos?

Robin2

For receiving data on the Arduino have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.

The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino and Arduino to PC communication.

You can send data in a compatible format with code like this (or the equivalent in any other programming language)
Code: [Select]
Serial.print('<'); // start marker
Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker


...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up