Pages: [1]   Go Down
Author Topic: Is it possible to split code into several .ino files?  (Read 703 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 1
Posts: 103
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 644
Posts: 50452
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

gnux
Logged

Pages: [1]   Go Up
Jump to: