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 Writing program without .INO file? (Read 2616 times)
IanS
Junior Member
**
Offline


Posts: 14
Joined: Jun 29th, 2016
Writing program without .INO file?
Jun 29th, 2016 at 12:53pm
Print Post  
Hi all,

I am working on planning a big project for my arduino and thus want to make sure my code is setup correctly. Since I know how to use CPP and H files I wanted to go that route. But according to some reading I was doing on visualmicro wiki I have to have a .INO file as my main sketch file is this correct? If so, is there anyway to have the actual program contained in a set of H and CPP files? Preferably I would do away with the .INO but....it doesn't seem thats possible.

Any help is appreciated. 

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Writing program without .INO file?
Reply #1 - Jun 29th, 2016 at 1:20pm
Print Post  
Hi,

You do need one .ino with the same name as the project and in a folder of the same name. That will be considered an Arduino compatible project.

The .ino should contain at least two methods:-

void setup(){} 
void loop(){}

The setup will be called once when the Arduino starts and the loop(){} will be called continually.

If you make use of any Arduino libraries they should be #included in the .ino so that intellisense will work. 

Other than that you can use cpp/h files in the normal way. #include a .h in the .ino so that you can jump from the loop or setup into your own code.

Do not create a cpp file with the same name as the project.

Hope this helps.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint