Calling C++ Code

Hi,

I am rather new to arduino programming, and I am wondering if it is possible to do, for example:

in some c++ source code file, call the arduino code and run via the main function in the source file?

Thank you.

When C++ files are compiled, the main function becomes the entry point, so I don't see how you could "run via the main function in the source file". Perhaps you should better explaining what you are trying to do, rather than how you are trying to do it.

I have a program that does a series of calculations and writing to files, and I want to make it possible to continue running the program and call an arduino program. This is more of just a theory question, I do not have an arduino sketch written yet, more I just want to know if it is possible, or if I should explore other avenues.

andre220:
and I want to make it possible to continue running the program and call an arduino program.

You mean like multithreading? No, these microcontrollers don't have multi-cores or operating systems.

Writing to files can also be problematic, unless you have provided some additional storage device and the code writing to the files was written using the appropriate Arduino-specific methods to interface to it.

I have a program that does a series of calculations and writing to files, and I want to make it possible to continue running the program and call an arduino program.

Where does this program run? If it runs on your PC, you'll have as easy a time "calling an Arduino program" as you would have calling Mars.

andre220:
in some c++ source code file, call the arduino code and run via the main function in the source file?

I didn't understand the question, I'm glad PaulS did.