Organising your code in the Arduino IDE
I have been revamping the code for Mr. Tidy and it has grown large enough (23Kb when compiled) to be a real headache to scroll through.
I know that some IDE's solve this problem by collapsing code but the Arduino IDE doesn't have this feature. The Arduino IDE has "Tabs" instead which I have not seen people use very much. In the past I have used these to seperate constants and IO pin definitions but you can also break your code into logical sections and store those sections in the tabs making it easy to jump from one section to another.
In my new code for Mr. Tidy many of the larger functions now have their own tab. I have grouped other smaller functions together into a logical group such as functions related to the gripper. See the attached code. I was a little annoyed that if you have a lot of tabs the IDE doesn't create multiple rows, instead they just disappear of to the side. Fortunately they are still fairly easy to access from the menu or using hot keys.
Note that my code segment tab names do not have an extension and do not need to be included at the beginning of the program.
Organising your code in this way makes it much easier to edit large programs. When you compile your code the IDE just treats all the seperate segments as one.
Good luck and enjoy!