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
Hot Topic (More than 8 Replies) Problem with starting a new project with VM and Studio 6.2 (Read 9556 times)
Jean-Marie45
Newbies
*
Offline


Posts: 5
Joined: Jun 9th, 2014
Problem with starting a new project with VM and Studio 6.2
Jun 10th, 2014 at 8:11pm
Print Post  
Hello.
First of all, sorry for my poor English, because my native language is French.
One week ago, I upgraded from Studio 4 to Studio 6.2 and I installed Visual Micro. I also have Arduino IDE 1.0.

I wanted to start a new Arduino project with VM. I gave it the name "Test". This is the code created by Visual Micro:

Quote:
/* 
* Test.ino
*
* Created: 6/10/2014 8:45:23 PM
* Author: JMCo
*/ 

#include "MyClass.h"

void setup()
{
     myClass.setup();
}

void loop()
{
     myClass.loop();
}


It compiles OK, but the code seems a mix of Arduino and C++.

In the "Solution Explorer" window, I see under "Visual Micro" the files "MyClass.cpp", "MyClass.h" and "Test.ino" (+ some other files).

I think the first time I tried (one week ago), the code created was true Arduino code but for some reason I ignore, things started to go wrong. For example, I lost the syntax formatting. Reading similar cases from the forum, I succeded to re-establish the syntax formatting by "repairing"  the installation of Visual Micro.  Undecided
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem with starting a new project with VM and Studio 6.2
Reply #1 - Jun 10th, 2014 at 8:45pm
Print Post  
Hello,

I am having difficulty understanding the problem.

Arduino is C++. Arduino projects can contain .ino and .cpp files (ok).

Questions...

Is the intellisense working? When you type "myClass." does a list of options appear?
  
Back to top
IP Logged
 
Jean-Marie45
Newbies
*
Offline


Posts: 5
Joined: Jun 9th, 2014
Re: Problem with starting a new project with VM and Studio 6.2
Reply #2 - Jun 11th, 2014 at 11:56am
Print Post  
Thanks for your answer.
I am not sure about the meaning of intellisense but look at this picture:
https://drive.google.com/file/d/0B1bhLjrA8qd1N2JyMWhhVUwxdkU/edit?usp=sharing
If I start to type "myClass", a context menu appears as you can see on the picture.
(I hope you can see the picture because this is the first time I use the sharing on Google Drive.)
« Last Edit: Jun 11th, 2014 at 11:56am by Jean-Marie45 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem with starting a new project with VM and Studio 6.2
Reply #3 - Jun 11th, 2014 at 2:12pm
Print Post  
Thanks, yes the picture shows everything is working well.

What problem do you think you are having?
  
Back to top
IP Logged
 
Jean-Marie45
Newbies
*
Offline


Posts: 5
Joined: Jun 9th, 2014
Re: Problem with starting a new project with VM and Studio 6.2
Reply #4 - Jun 11th, 2014 at 3:39pm
Print Post  
Well, perhaps I have no problem at all, but if I import the simplest Arduino example (blink.ino) in the Studio + VM environment, one can see the differences :

https://drive.google.com/file/d/0B1bhLjrA8qd1NTlQSnZDbXl0bms/edit?usp=sharing

There is no call to "myClass.setup()" nor "myClass.loop()" and the files "myClass.cpp" and "myClass.h" do not exist.

So, what do I have to do with these calls and these files in my "Test" project ? Throwing them away each time I create a new project ? Or learning what to do with them by reading some C++ tutorials ?

Sorry, my question is probably stupid for someone knowing just a little bit of C++. Unfortunately, it is not my case.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem with starting a new project with VM and Studio 6.2
Reply #5 - Jun 11th, 2014 at 3:48pm
Print Post  
Hi,

I see your confusion. Previously you used the menus to add a new "cpp" file to your test sketch. maybe you forgot that you did this  Smiley

You can do this within any sketch by right clicking the project in the solution explorer or by using the other Visual Micro menus available in various places.

To remove this code from a sketch, you must right click a source file name in the solution explorer and click "Delete". Or you can delete/move the cpp/h files from the sketch folder and then re-open the project.

You are experiencing correct software behaviour and as you learn more this will become obvious to you and will make sense.

Best of luck with your projects
« Last Edit: Jun 11th, 2014 at 3:49pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Jean-Marie45
Newbies
*
Offline


Posts: 5
Joined: Jun 9th, 2014
Re: Problem with starting a new project with VM and Studio 6.2
Reply #6 - Jun 11th, 2014 at 6:37pm
Print Post  
Quote:
I see your confusion. Previously you used the menus to add a new "cpp" file to your test sketch. maybe you forgot that you did this   Smiley


I don't think so. To be sure, I created a new project called Test_2. On the "New Project" page, I have only one choise under Visual Micro : Arduino Sketch with C++ Class Example.

https://drive.google.com/file/d/0B1bhLjrA8qd1azVoTDVXSkpmZ3c/edit?usp=sharing

And when I click on "OK", I receive exactly the same template as whith the first "Test.ino".

https://drive.google.com/file/d/0B1bhLjrA8qd1Si1TTkVUSmpLOXc/edit?usp=sharing

Perhaps it is just a matter of making a new ordinary Arduino template without the C++ Class.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem with starting a new project with VM and Studio 6.2
Reply #7 - Jun 11th, 2014 at 7:04pm
Print Post  
Oh sorry, I see the you used the new project wizard.  At the root of the wizard (don't drill down to visual micro) is a simple Visual Micro Arduino project with a single .ino called "Arduino Sketch".

Under the Visual Micro branch is the Cpp project option called "Arduino Sketch with C++ Class Example" which creates a new project with one .ino and one .cpp allowing newer users to see how to add a cpp file. This is the option you used so correctly created the project with cpp. It is the same automated workflow as manually adding a cpp as described above.

Any Arduino project can include multiple .ino files and multiple .cpp files. This structure and facility is designed by arduino and explained well within the tutorials on arduino.cc

You will find the new project wizard documented here, the document also points out the difference between the two options. http://www.visualmicro.com/page/User-Guide.aspx?doc=Create-New-project.html

Another alternative way to create a simple sketch is "File>New>Sketch Project". This is designed for newer users and it ensures the sketch is saved to the same place that the file menu in the Arduino IDE looks for sketches. Sometimes this is a preferred method of creating a project.

Hopefully the confusion is now solved and the various capabilities understood? The main point is that all of the options that Visual Micro provides create valid Arduino projects based on the rules defined by http://www.arduino.cc



« Last Edit: Jun 11th, 2014 at 7:08pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Jean-Marie45
Newbies
*
Offline


Posts: 5
Joined: Jun 9th, 2014
Re: Problem with starting a new project with VM and Studio 6.2
Reply #8 - Jun 11th, 2014 at 8:31pm
Print Post  
I really thank you for your help.

I did not realize there was two different templates to create a Visual Micro project.

I am sorry. Either I read too quickly the documentation, or my neurones are becoming a bit scanty (I am nearly 70).
« Last Edit: Jun 11th, 2014 at 9:24pm by Jean-Marie45 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem with starting a new project with VM and Studio 6.2
Reply #9 - Jun 11th, 2014 at 8:33pm
Print Post  
No problem I pleased it makes sense. 

The new project wizard stuff is new in the last release. In the future there will be more examples under the "Visual Micro" Smiley branch and it might then make more sense that the top level gives quick and easy to find "new Arduino Sketch"  Smiley
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint