You need to declare your function before you use it. So either the whole function body needs to be before the usage, or you must add a function prototype declaration.
Without very specialized software that can create two new devices with the correct "teeing" policy, it's not going to be possible. Only one program can open a serial port at a time (certainly and have it get anything intelligible out of it...)
I would suggest you may want to add a second serial port. Use an FT232 adaptor to communicate on another serial ...
At the end of the day, an Arduino library and the Arduino core are just files full of code.
There is nothing to stop you creating a project in Atmel studio (or wherever) and importing all those files into your project.
You will need all the core files (hardware/arduino/core/arduino/*) plus all the files for the libraries you want to use.
Visual Micro supports all Arduino libraries in the same way that the Arduino IDE supports these libraries.
When using Visual Micro in Atmel Studio your sketch code remains identical to the Arduino IDE. You can switch between the two IDEs and see the same compiler results.
If you can not see your user libraries on the "Atmel Studio>Projects>Add/Import ...
Make a new tab in the IDE (top RH corner) with a xxx.cpp file name. Put your code in that. Leave the .ino file blank. Then it will compile. You need to add:
... to the start of the .cpp file.
More information: How to avoid the quirks of the IDE sketch file pre-preprocessing
To clarify the question about libraries ...
You do ...
Turn on Verbose Compiling in the Arduino IDE and you will see all the intermediate file names (they are done in a temporary folder).
/home/nick/Development/arduino-1.6.7/arduino-builder -dump-prefs -logger=machine -hardware "/home/nick/Development/arduino-1.6.7/hardware" -hardware "/home/nick/.arduino15/packages" -hardware "/home/nick/Arduino/...
Note, this answer is not technically for the full edition of Visual Studio, rather Visual Studio Code.
Microsoft has released an Arduino extension for VS Code that can do most (all?) of the required items in the OP's list.
Added this answer as a free alternative to the accepted answer.
The Arduino should read only whole lines (non-newlines until a newline). Discard the line if it doesn't start with "stat>".
This will make your program more robust and less likely to fail with bad input. Fixing the transmitting app instead still leaves your Arduino vulnerable.
Consider the rule of thumb for serial communication: "Be restrictive in what ...
I haven't done it yet, but you could do the following things to get a somewhat close approximation:
Make three different projects, one for the PC (only), e.g. Visual Studio, and one for Arduino (with the default Arduino IDE or e.g. Visual Micro). The last will be a generic library to be used for both the PC and Arduino.
Use the Arduino specific libraries ...
I have final solution for uploading application from VS 2019.
Visual Studio have Tools > External Tools... where is possible add the PlatformIO command for uploading application pio run -v -t upload
After that is possible adding custom button to Toolbar
Fantastic thing is, that during upload you can Stop the process
It works with Arduino IDE either 1.8.9 OR 1.8.12 BUT the VS code extension is broken. So
You have to downgrade to January release 1.42 AND
Then turn off automatic updates for the moment.
How to get the release: Click here
Before installing /downgrade
The excessive debug logging is caused by running Java with -DDEBUG=true. Adding -DDEBUG=false to the C:\...
I use the Arduino IDE to 'build' everything.
However, in case of a bigger project, I use a 'decent' code editor (Visual Studio in my case) to edit, and the Arduino IDE to build.
Also, because I prefer testing all non-Arduino related code on the PC (not on the Arduino), the Visual Studio (C++) project uses some stub classes I created (specifically for my ...
The first time you verify your sketch you are confronted with a list of available sketches (INO's). As soon as you select one of these it gets stored under "sketch" in .vscode/arduino.json.
If you zero this, "", you'll once again be asked which sketch to set as "main sketch".
This "device context" is stored per workspace so you might consider narrowing your ...
I think it is the de facto standard for VS (of course the default Arduino IDE is used most).
However, I think some advanced features (like breakpoint if I recall right) is only temporarily for free and you have to pay later for a subscription.
Note however, that debugging/breakpoints are not used often anyway since mostly it's more realtime controlled than ...
I imagine Code Gorilla's given you the proper, specific answer you needed. I simply wanted to address your first (more general) ask,
Am I able to send instruction from my computer, from another compiler, via the Arduino USB port?
... and mention some other ways I've done this before. As long the Arduino's listening to the serial port for some specific (...
Visual Studio's web server is restricted to only servicing clients on the machine it is running on.
To do what you want to do there are a number of things you can do.
Get a full licensed copy of IIS. (Please stop laughing)
Get a version of Apache (might affect your server code and will take a while to setup)
Write yourself a 'proxy server'. I think if you ...
You're using a template class. A template class is a special corner case that breaks the "code in .cpp and definitions in .h files" rule.
Because it's a template it can't be pre-compiled - it needs to be specially compiled each time it is used, so that it can get the right values compiled in to the template place-holders, which are provided by the CU that ...
One possible approach is to guard the body of that sketch with an #ifdef ... #endif pair, and use Visual Micro's “Project Properties” to define (or not) a preprocessor symbol. [If the .ino or .pde in question is used as a #include file, you would instead guard all the #include instances.]
Refer to the “Project Defines” page at visualmicro.com for how to ...
As you have found, Visual Micro will not consider the project to be an Arduino project if you do not have a "project_name.ino" included in the project
A cheat is to create a "project_name.cpp" and include it in the project. This will cause the .ino to be ignored during compilation.
EDIT: The project_name.cpp takes priority during compile, therefore the ....