Go Down

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


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?


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(','); // comma separator
Serial.println('>'); // end marker

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

Go Up