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 need help finding .h file (Read 2233 times)
Harrzack
Member
***
Offline


Posts: 133
Location: Lindenwold, NJ USA
Joined: Dec 28th, 2012
need help finding .h file
May 16th, 2013 at 11:09pm
Print Post  
Making my first attempt to create an Arduino library.  Just starting with a plain .ino for now. I plan to create some classes and will need my own header file. I've created on and saved it on the project folder, but in the .ino file my #include doesn't recognize the name.  This path thing has prob been asked a thou'd times!!   I'm running in VS 2012 with latest VS.

Where should I put my own .h files?  Path setting?  Huh

=Alan R.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: need help finding .h file
Reply #1 - May 16th, 2013 at 11:29pm
Print Post  
I am pushed for time so would ask that you learn how to create an arduino lib in the arduino.cc/forum

Once you understand how to create an arduino lib in the right way it will be automatically recognized in both the arduino ide and vs

If you do manage to create one it will appear on the "project>add arduino library>user" menu which can be clicked to insert into the current sketch. Once you understand how libs work you would also be able to add the lib manually to the sketch


Once you have added the lib to the project the menu item "Project>show all arduino files" will bring the library sources into your test sketch.

Remember that your actual sketch "will use" the library and will "not be" the library

edit: this might help...

create a folder called MyFirstLib under c:\my documents\arduino\libraries
add a .h called MyFirstLib.h
if vs is already open click "Project>add arduino library>refresh"
if not already open then open a sketch
then click "Project>add arduino library>use>MyFirstlib"
then click "Project Show all Arduino files"

you can add #includes for libs manually to the main pde/ino file but the libs must reside under the libraries folder mentioned above. adding #includes manually will not be recognized by vs until you save the pde/ino

there are no paths to set because you only have the option of a couple of known auto discoverable locations

« Last Edit: May 16th, 2013 at 11:38pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint