Hi,
I have an opencv code running on Ms Visual Studio 2013, the code is on colour detection (eg red colour).
SO once red colour is detected on a camera connected, the code will output to a txt file using the iostream library like this
The Arduino can't read a text file from your computer. Easiest way would be to let VB send out data trough the serial port to a connected Arduino at the same time as writing to the file.
septillion:
The Arduino can't read a text file from your computer. Easiest way would be to let VB send out data trough the serial port to a connected Arduino at the same time as writing to the file.
I have an opencv code running on Ms Visual Studio 2013,
No, you don't. Visual Studio is a program for writing programs. It is not a program for running programs.
And from here, i will send out the number 1 to show red colour is detected.
Send it out how? What is the purpose of opening a file and writing just the value "1" to it? The presence of the file tells you nothing. The contents of the file tell you only that the color red was seen at some location at some time. Not where; not when.
I wish there is something that can read the txt file and load the number to the arduino.
There is. It's your application.
My ultimate goal is to get a digital signal from Visual Studio that can be understood by arduino and transmit out via Xbee
Give it up now. The likelyhood of Microsoft making Visual Studio able to open a serial port is less than that of me winning the lottery.
Applications that YOU develop using Visual Studio CAN be made to open a serial port.