How to connect a c++ program with a program in arduino IDE

Well we are group of 4 people in which 3 are working in the image processing part of the bot and 1 is working on the autonomous part. We just have one problem that the image processing part is in C++ while the autonomous part is programmed in arduino IDE. So is there any library to connect both the codes?

It’s not clear what you’re asking. What do you mean by “connect both the codes”? Are both codes going to be running on the same microcontroller.

By the way, Arduino sketches are C++. The Arduino IDE does automatically make a couple of changes to the .ino files before compiling them as C++:

  • If there are multiple .ino files in the sketch, concatenate them into a single file, starting with the file that matches the sketch folder name, followed by the rest in alphabetical order.
  • Add #include <Arduino.h> at the top of the file.
  • Insert automatically generated function prototypes for any function that doesn’t already have one.
  • Add #line directives to make warning/error messages still match the original sketch files.

The Arduino is programmed with C/C++ using several different IDEs, including the Arduino IDE.

What computer is doing the image processing?

Consider using a serial connection for data transfer. TTL RS232 is a possibility, SPI over short distances is another.

There is a camera attached to the arduino which helps in image processing but the code for that is written in C++ while bot's movements according to the image are coded in arduino IDE. So yes I want to use both programs in one board

How have you been compiling and testing the camera code?

There is a camera attached to the arduino which helps in image processing but the code for that is written in C++ while bot's movements according to the image are coded in arduino IDE. So yes I want to use both programs in one board

Is this explanation of your project the very best you can do?

If so, don't expect much help on this forum. Otherwise, take a few minutes to read and follow the directions in the "How to use this forum" post.

If I understand you correctly

1) You have an application in the Arduino that (amongst other things) transfers data from a camera to a PC. 2) You have an application that runs on a PC that reads this data and processes it.

If the above is a correct description, the answer to the question is "No". Programming environments (IDE or whatever) are not involved in the above two; programming environments are basically only used to write / compile / link the code. In case of the PC application, you can also use the programming environment to debug the code on the PC; in case of the Arduino IDE you can also use it to upload code.

If you don't need to test the communication at the PC side, just store a number of images (data from Arduino) on the PC and develop the image processing side of things files instead of communication.

Else get a second Arduino (and camera), program it with the code that reads the camera and transfers the data and give that to the team that writes the PC application.

You wrote a cool message in "Word" and started a reddit post online. Both in english. How do you combine the two?

CUT AND PASTE.

Its basically what you are asking.

This is why everyone is going "huh?"

-jim lee

I suspect the Arduino may be controlling the camera but is not actually processing the images. Arduinos don’t have the performance for that.

If the real question at the bottom of the OP’s vague descriptions is “how do we send messages between an Arduino and a PC” then 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.

You can send data in a compatible format with code like this

Serial.print('<'); // start marker
Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker

…R