Go Down

Topic: Where to find Information on how to organize larger Arduino projects? (Read 1 time) previous topic - next topic

dhenry

Quote
Is there somewhere a good source of how to organize larger Arduiono projects?


This is the concept of "project": you put all modules together. That approach requires coding for portability: you break down tasks into well defined and self contained modules. The interface is defined in .h files and the actual activities in the .c/.cpp files.


Nick Gammon

I just want to point out that you don't literally have to create the tabs. Close the sketch. Copy any extra .cpp and .h files into the sketch directory (alongside the .ino file). Re-open the sketch. All the new .cpp and .h files are automatically turned into tabs in the IDE (and considered part of the project). However to get them compiled you still have to #include any .h files from the main .ino file (not quite sure why as surely their presence in the directory should be enough?).
http://www.gammon.com.au/electronics

tuxduino

Quote
However to get them compiled you still have to #include any .h files from the main .ino file (not quite sure why as surely their presence in the directory should be enough?).


This is one of the (not so many) arduino-isms that one encounters when moving from simple one-timers to more structured code...

michinyon

Quote
I just want to point out that you don't literally have to create the tabs. Close the sketch. Copy any extra .cpp and .h files into the sketch directory (alongside the .ino file). Re-open the sketch. All the new .cpp and .h files are automatically turned into tabs in the IDE (and considered part of the project).


The problem with this requirement,  is that you cannot easily open a header file  which is part of a library  and see what is in it.

Nick Gammon

To look at libraries you need an external text editor. Virtually anything would do, although personally I use Crimson Editor on Windows, and Xcode on the Mac.
http://www.gammon.com.au/electronics

marco_c

To be honest the Arduino IDE got frustrating for software development for me when I started to get 4-5 files in a project. I discovered and started using the Visual Micro Arduino extensions for Visual Studio and have been much more productive. For one off and small code I still use the ide as it is faster to load and good enough.

If you are interested details are at http://www.visualmicro.com/.
Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Go Up