Go Down

Topic: Is it possible to split code into several .ino files? (Read 729 times) previous topic - next topic

lightaiyee

Dear Arduino experts,

When the main .ino file gets big, things get rather messy. Is it possible to split into multiple .ino files? How do I include another .ino file?

Is it something like this?

#include "subfile.ino"

I cannot find documentation whether this can be done. Can someone point me to some link, if it exists?

Thank you.

PaulS

Quote
Is it possible to split into multiple .ino files?

Yes.

Quote
How do I include another .ino file?

You don't need to. The IDE will merge all the .ino files into one .cpp file to pass to the compiler. You don't have to "help".

All you need to do is use the new tab icon to create a new tab, and name the file for that tab using a .ino extension.

gnusso

hi could you give an example in order to understand the usage ? coulbe very usufel for shirink logical the project :-) thanks

gnux

Go Up