Is there any way to reorder tabs? I have my sketch split among several tabs for readability, and it seems I need to move them around so variables are declared before they are used.
For the life of me I cannot figure out how to do this - is it something obvious?
Right, but I;m talking about "normal" tabs rather than .cpp or .h tabs. I think the IDE concatenates all normal tabs into one file before compilation.
In my case I have some global variables describing configuration of the external hardware; I wanted them out of the way so I can concentrate on the code.
Then put them in a header file (e.g. globals.h) and #include them in your sketch at the top #include "globals.h". They are then guaranteed to be at the top of your sketch. This is one of things header files are good for.
Hi,
Prof. Chaos is right, the files are processed sorted on their filenames.
But the main file that gives the name to the sketch is always processed first. So you should be fine placing all global declarations at the top of the main sketch-file.