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 Select Directory for NEW project and a few problems... (Read 3510 times)
French Cow-Boy
Newbies
*
Offline


Posts: 1
Joined: Aug 11th, 2015
Select Directory for NEW project and a few problems...
Aug 11th, 2015 at 6:20pm
Print Post  
I just downloaded, installed and started to test Visual Micro for Visual Studio 2015. Went very well, kudos, I will certainly use this extension quite a lot.

Now, for the little problems:
-- I wanted to open an existing .ino file in a existing directory. I admit I forgot that, being in Visual Studio, a project was needed. But I did not understand WHY Visual Micro was complaining about not finding a file named "sketch"? He could have complained about needing a project, or better yet, create it....

-- So I went to create a new project, but it never asked were I wanted it to be created, and did it in /Documents/Arduino. Sorry, that does not suits me at all....

-- For this reason, I copied the content of that newly created project where I wanted it to be. As I had copied and renamed the original file to be named "sketch", I had errors about variables being declared twice, even after I had excluded that original file from the project. I deleted it to build without errors, so it looks like that excluding a file from a project does nothing.....

Little things to iron out....
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Select Directory for NEW project and a few problems...
Reply #1 - Aug 11th, 2015 at 7:27pm
Print Post  
Hi,

I'm not sure I fully understand but let me make a few points and see if they make sense to you.

1) Arduino Ide does not use projects. The Arduino Ide compiles anything in the folder of the current "sketch". So visual micro does the same which means that it doesn't matter what is in the project. 

2) When you re-open a project visual micro should ensure that all source files from the current "sketch" folder are in the project. This helps users understand point 1). 

3) We usually recommend people use the Arduino ide for a few hours/days so that Arduino is understood. You will see that it prompts you to open and create new "sketch" programs in mydocuments\arduino. This location is called the "SketchBook" folder and can be changed in the arduino ide preferences window. It is not mandatory just a suggest to help newer programmers keep their code in a known location. Any sketch programs created  in the sketchbook folder appear on the File>Open menu in the Arduino Ide making them easy to find and open. It is also allowed to create and open sketches outside of the sketchbook folder.

4) Because Arduino does not use projects it uses a simple rule to determine a valid sketch. The [sketch_name].ino must have the same name as the folder that contains, must not contains spaces or strange chars, must not start with a number. So a valid arduino program might be in a folder called \Sketch_Name and contain a source code called Sketch_Name.ino. These are very important rules also for Visual Micro but for Visual Micro the name of the Visual Studio project must also be the same. If the 3 names are not the same then Visual Micro will not manage the project and will not consider it an Arduino project.

5) The two Visual Micro menu items "File>New>Arduino Sketch" and "File>Open>Arduino Sketch" default to using the Sketchbook folder. + In the Visual Micro Ide locations config window you will see the "optional sketchbook" folder.  You can set it to a different location if you want but be aware that when you install libraries they are installed into sketchbook/libraries folder so don't mess with the path unless you really want to. So Point 5) is Visual Micro offering the same functionality of the Arduino ide and Arduino community.

6) "File>Open>Arduino Sketch" will open an existing (valid) Arduino .ino file, a vs solution or a vs project. If only an .ino file exists it will prompt you if you would like to have a visual studio project created. If you click OK a project will be created that adheres to the rules described above and the sketch opened for editing.

7) With an empty Ide you can also use "File>Open>Text File" to navigate to and open any existing valid Arduino sketch/program .ino  and Visual Micro will follow the workflow described in point 6) above

8) You can also create a Arduino project using the pre-defined c++ templates that Visual Micro installs into Visual Studio. This method means that you use the standard Visual Studio method to create a project via "File>New>Project". You should see a Blank Arduino template and also a section called Visual Micro with a couple of templates. Creating projects via this system uses the standard visual studio configuration settingsthat enable you to decide where projects should be located.

9) After you have created or opened an Arduino sketch Visual Micro will have created a Visual Studio project for you. This is just a standard basic VS C++ project with the correct name as described above. This means that after the project has been created you can open and close the project as you would any other Visual Studio project. There is not difference.

I hope you can see that all roads are open to you and that you have complete flexibility. If anything I have said is not clear or correct then please say then I will add these points to the FAQ on visualmicro.com

The idea is to have the freedom of Vs but ensure that "projects" remain compatible with the Arduino Ide should there ever be a need to use it or share code with non-vs users

Thanks

« Last Edit: Aug 11th, 2015 at 7:29pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint