Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
How can I use cpp only without ino? (Read 718 times)
YLL
Newbies
*
Offline



Posts: 2
How can I use cpp only without ino?
May 16th, 2018 at 3:38pm
 
Hi,

I'm new to Arduino and VM. Just wondering if I can get rid of ino and build with cpp only. I scanned through documentation and didn't find anything except the suggestion of using cpp instead of ino.

Thanks in advance.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9493
United Kingdom
Re: How can I use cpp only without ino?
Reply #1 - May 16th, 2018 at 3:53pm
 
If you do not want to use the visual micro serial debugger then you add a project_name.cpp to the project. You DO need to leave a project_name.ino but it can be empty and will not be compiled.

edit

You can also add a main.cpp to the project which will override the main.cpp in the arduino core and an arduino.h which will override the entire core. However this is expert mode.

Finally you can create your own core and have your own custom board definitions very easily by creating a core under mydocuments\hardware\[CoreName]. The folder structure must conform to the arduino 3rd party hardware spec. and contain boards.txt and optional platform.txt. The core can inherit part of another core or be an entirely new core.

Back to top
« Last Edit: Oct 1st, 2018 at 12:44pm by Visual Micro »  
WWW  
IP Logged
 
YLL
Newbies
*
Offline



Posts: 2
Re: How can I use cpp only without ino?
Reply #2 - May 16th, 2018 at 4:57pm
 
Visual Micro wrote on May 16th, 2018 at 3:53pm:
If you do not want to use the visual micro serial debugger then you add a project_name.cpp to the project. You DO need to leave a project_name.ino but it can be empty and will not be compiled.



Got it. Thanks!
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9493
United Kingdom
Re: How can I use cpp only without ino?
Reply #3 - May 16th, 2018 at 5:10pm
 
Great.If you use "add library", then #include examples will be put in the .ino for you to copy

++

In the last release there is a vMicro>Compiler option to override any core code. For example, with the option enabled, if the core you are using uses a main.cpp, then adding a main.cpp to the project would override the core.  It's the main.cpp that calls the ino setup() and loop() so often a better place to start if you want complete control.

Back to top
« Last Edit: May 16th, 2018 at 5:11pm by Visual Micro »  
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print