organizing larger projects in arduino IDE

Hello everybody!
Im building a large project and i desperately need order in the code for me to make sense of it.

So ive came up with a scheme of things that seems to be working for me, but i might be missing something..
And since ive had some trouble gathering how to build a big project, i figured i´dd share, prehaps someone else finds this useful, or better yet, can improve on "my" concept :slight_smile:

First off, file structure:

In my arduino projects folder i have created a root project folder, for my specific project (bikeLiteProject).

It looks like this:

BikeLiteProject/ (project home folder)
|-BikeLite/ (arduino sketch home folder)
| |
| |- BikeLite.ino
| |
| |- src/ (my "local libraries")
| |
| |- part1/
| | |
| | |- part1.ino // the subParts test enviroment, not used in main project code
| | |- part1.h // the actual part1 file
| | |- part1.cpp
| |
| |- part2/
| |- part2.ino // the subParts test enviroment, not used in main project code
| |- part2.h // the actual part2 file
| |- part2.cpp
|- Documentation/
|- POCtests/ (this is where i play around, testing everything)

Ive noticed that its possible to use folders inside the src folder, allowing me to split up my project into sub-components and placing each part in its own arduino sketch home folder.

This allows me to focus on one particular part of my project code, by just opening that specific part in a separate project window in the Arduino IDE, with all the related files available as tabs in the IDE editor.

Everything is then linked in the master project file with
#include "src/part1/part1.h"
and treated as any other header file.

Next big thing to maintain order is documentation!
Document everything, preferably with a tool like doxygen to create very useful and easy-to-use overviews and details about the project.

Have a look at using GIT to organise your versions too

To follow up on @hammy 's comment.

I use Git and Git-Submodules to manage my projects and the libraries I am developing along-side them.

You can essentially layer Git repos inside of each other, however deep and broad you want. This means you can make changes to your libaries and version control that library in a seperate Git repo which you can use in other projects, even as submodules in other projects if you want and syncronize them.

If you have come accross this and aren't using Git yet, LOOK INTO IT, You'll love it, I promise.

I have recently Endevoured in a new job with real-time systems and writing purpose-built sensor libraries for smaller code footprint and faster runtimes. Meaning i've been developing inter-mingling libraries in parallel. So using a structure similair to yours with submodules has been Awesome