Pages: 1 [2]   Go Down
Author Topic: Where to find Information on how to organize larger Arduino projects?  (Read 1387 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?).
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Offline Offline
Edison Member
*
Karma: 28
Posts: 2037
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 27
Posts: 1184
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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/.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Pages: 1 [2]   Go Up
Jump to: