Hello All
I have been searching & reading a lot of content about compiling errors when using tabs in Arduino IDE and found a way to circumvent
the issue. I had the same issue when I was trying to clean up my sketch, a simple 7 segment clock, adding tabs in IDE for function() calls and always
landed with errors. I found errors occurred while copying portion of your sketch from within IDE and pasting them into tabs.
Objective: To break up a large program, Function calls, into more readable content using Tab in IDE and more importantly compiling without errors.
What you really got to do is to copy the ' jumbled ' code you wrote in one single INO file into a plain text file. I am using NotePad++ for this which has some awesome
features and its a freeware as well.
Once you have copied your code into NP++ ( note pad ++) you just save it as a PLAIN TEXT file using "save as". Make sure you remove any INO extension or INO in the
file name you are going to save.
Start IDE, start a new Sketch (FILE>NEW). Now with your NP++ open, copy relevant content and paste it on your main program. I normally copy all , Variables and
setup() and the void loop(){ ...} in the main program.
Now create your "tab" and copy and paste from the np++ ( this is important .. copy/paste only from np++ text file), relevant function() calls or what ever into
the new tab. I usually name tab with a prefix a, b ,c followed by the file name, for example a_domyclock, b_docalc, c_dodisplay since IDE sorts the tab in
alphabetical order and its much easier to follow while programing and no jumping tons of code to find a particular variable etc. Now, do the same with other functions
into different tabs. Compiles without any error what so ever.
Inference:
Cutting and pasting function() calls from within IDE to tab -> did not work/Errors reported by IDE
Cutting and pasting function() calls from NP++ to IDE to tab -> WORKED.
Can't really figure out whats going on within IDE to cause this issue.
Will like to hear from you guys if got it working too...
Regards
Vijay