Multiple Iso files

Good evening.

Upto a week ago my project was compiling and working smoothly.

I resumed work today and could not compile. Every reference I have to separate ino file is now being errored as not declared.


Possibly there is a missing or additional { or } bracket in your main .ino somewhere?

image
Fix this error first

That's it.
Thank you very much.

How does the compiler handle multiple files? to my understanding, first the mainfile similar to the folder is compiled, then the rest in alphabetical order according to file name?

if so can I put void setup part in a dedicated file and name this file as A_Setup.ino?

Before compiling the IDE combines all ,ino files in the sketch directory into a single file with the main one coming first then the others in alphabetical order

In general, functions can appear anywhere in the combined .ino file but there are some exceptions that require a function prototype to be present early in the file when the action function is later in the file

Why do you want to put setup() in a separate file ?

to reduce reduce the amount of code in main. Also, I have some bit level configuration in the setup() and would like to get it out of the way

The compiler is quite happy if there is nothing at all in the main .ino file if you want to take it to extremes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.