I've done some research on tabs but just wanted to get confirmation that I was understanding it correctly before I made a mess.
I am about to make my first largeish program and want to split it up to make it easier to debug etc.
So if I split it over several tabs/.ino files the IDE will concentrate it into a single file when compiled.
It starts with the main file, same as the folder name, then adds other file alphabetically. So i need to make sure all my includes and global variables need to be in the first file, setup could be in the second one and loop in the third etc.etc.
Is the above correct and is there anything else I need to be aware of?
I just don't want to spend the next week writing code to find out it will never work because of how it is laid out.
seems that is compiles each source and library file separately into a .o, links them into a .elf file which is then converted to a .hex (not shown) for downloading to the target board
I wouldn't know where to start with splitting a program into different files with different extensions. Was just hopeing to use tabs at that seemed fairly straight forward.
GForce2010:
setup could be in the second one and loop in the third etc.etc.
It sounds like you're already aware, but just to be sure, you don't need to place the functions in any specific order. The Arduino IDE automatically generates function prototypes for all functions in .ino files that don't have a manually added prototype. These prototypes are inserted (in an intelligent manner) at the top of the first tab. This means you can organize your functions in any order you like.
GForce2010:
Is the above correct
Yes. You got it exactly right.
GForce2010:
is there anything else I need to be aware of?
Nope.
GForce2010:
Was just hopeing to use tabs at that seemed fairly straight forward.
That's perfectly fine. I do know how to use .h, .cpp, etc. files in sketches, but I almost never do it because I find the automated function prototype generation feature very convenient, and this is only done for .ino files.
Splitting the sketch into tabs makes navigation through the code of a large sketch much faster than scrolling through thousands of lines in a single file.
I just don't want to spend the next week writing code to find out it will never work because of how it is laid out.
Creep up on the solution rather than trying to implement it all at once.
I have a data logging sketch that I decided to add a browser based interface to so I added a couple of functions to it but the browser functions started to get more numerous and complicated so I added a new tab, named it webFunctions.ino, copied the browser functions to it and just went on programming. The new .ino file is compiled along with the main one and everything just works