Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Looking to crol Arduino via VS C++ project (Read 3750 times)
Rob Roberts
Newbies
*
Offline


Posts: 2
Joined: Jan 6th, 2016
Looking to crol Arduino via VS C++ project
Jan 6th, 2016 at 6:50pm
Print Post  
Hello,

  The Visual Studio Ardunio plugin looks great, but I think I am looking for something a little different.  My primary requirement is not to write arduino code in VS, but to write C++ in VS to control the Arduino.

I have found a way to do this via serial at http://playground.arduino.cc/Interfacing/CPPWindows, but it seems limited to sending characters.

Is there a better/easier/more robust solution to doing this?

Thanks!

Rob
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Looking to crol Arduino via VS C++ project
Reply #1 - Jan 6th, 2016 at 7:07pm
Print Post  
Hi,

Whatever you do you will need something running on the Arduino. There isn't any serial to read or write from windows if a program on the arduino isn't running.

There is an Arduino library called Firmata that exposes all digital IO via Serial so you can then remote control the arduino using the intellisense of a windows or another c++ program.

You can learn about firmata here https://www.arduino.cc/en/Reference/Firmata

If all you do it open the firmata example and upload to the Arduino then you don't need Visual Micro unless you then want to develop your own bespoke copy of Firmata or debug the existing Firmata code.

The example you posted shows how to read/write serial from C++ although doing so from C# is much easier. If you can run with windows .net you can use the System.IO namespace which contains really easy to use Serial read/write without restriction.

You might also find that creating a small Arduino program to expose functionality that can be called remotely via Serial is an option to consider. Where as Firmata is good it can leave the Serial  to handle too much/ For example reading a gps and sending the coordinates via Serial instead of the entire GPS message can be much easier to handle because there are libraries that already read the GPS stream and extract the info from it.

Lastly could look at what Microsoft have done for Windows 10 Arduino integration. They use Firmata and Serial to enable control via phones, tablets etc. They have made a number of pc based examples to work with many different Sensors via firmata so have invested effort in Firmata where not many others have bothered.

Hope this helps
  
Back to top
IP Logged
 
Rob Roberts
Newbies
*
Offline


Posts: 2
Joined: Jan 6th, 2016
Re: Looking to crol Arduino via VS C++ project
Reply #2 - Jan 6th, 2016 at 7:17pm
Print Post  
Tim, 

  Thanks so much for the quick and detailed response, this is exactly what I was hoping for!

I have used the very nice windows 10 arduino libraries from c# and it worked great, but unfortunately I have a C++ robotics SDK I need to integrate, and am tired of the hassle of trying to call a C++ project from a C# project.

Firmata looks pretty straightforward on the Arduino side, and it looks like https://ms-iot.github.io/content/en-US/win8/samples/Firmata.htm has the C++ code I need on the PC side
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint