1

I'd like to find out:

  • how big can an Arduino project get, is there some limit?
  • are there examples of large open source code bases? I did some research but find only example projects with single .ino file. Are there projects with multiple files e.g. functions, constants in separate files say to avoid a 10K+ .ino file?
3
2

Big projects are likely not developed with Arduino IDE. Arduino IDE was make for designers/inventors, not for programmers.

Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast prototyping, aimed at students without a background in electronics and programming.

Source

Programmers will use a fully-fledged IDE which has many features a programmer needs on a daily basis, such as:

  • handling multiple files efficiently
  • allowing to create libraries instead of just setup() and loop()
  • code completion (suggestions as you type)
  • debugging (inspection and changing of variables at runtime)
  • refactoring (modifying the structure of your code without changing the behavior)
  • integrated version control (like Git / Github)

Such an IDE could be Eclipse with an Arduino Plugin or Atmel Studio and perhaps Visual Studio.

So, what do you need to look for? Don't look for .ino files. Instead, look for .h and .cpp code, just like other non-Arduino C++ code.

Some examples:

0

Each sketch uses Flash memory, you can see this when you compile your project. You also can see how much percentually you have used.

And as jsotola explains, libraries are examples how multiple files can be used.

However, next to you .ino scene (in the same folder) you can put .h, .c and .cpp files which are automatically compiled (when used by the .ino file). However, if you use too many files, because tabs are placed horizontally in the Arduino IDE, it's better to use a decent editor. And while doing that, you use the Arduino IDE to compile (only).

0

Thats an example how to organize by function groups.
Other good complex examples can be found when searching for
Arduino esp8266 webserver site:github.com
The limit is basically your IDE -If you use ArduinoIDE the limit is (without already tested and working lib files) around 20 files, more is a pain in the a** to handle.

I keep the length of my files between 500 - max 1000 lines. For documentation and keeping relationship diagrams (valuable for debug) I use doxygen with the graph extension.

When using an IDE like eclipse you can use more files, you have a good overview over your classes, but time to spend (and learn) configuring a project is initially much higher and there are sometimes (release dependent) breaking changes in the tool chain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.