Im trying to build something that's more advanced than my level of programming, a e-bike controller to handle the vehicle lights and sensors, as well as e-motor management (cut-off, throttle and so on). Ive started from scratch (yet again), this time only implementing the main control structures before populating each function with their desired behaviors.
Now, my desire at this stage would be to split up the project code, placing much of the program bulk in their respective header files instead of just having a single long .ino file.
Its getting hard to find my way around almost 1000 lines of code & comments and the project would be much more approachable if i could find each component more easily.
I tried splitting up a earlier version of the project into different files, (tabs in the IDE,) but its a LOT of work, copy/pasting multiple tabs into a long "code"-field of text in the web-emulator every time i change something in the program code..
Now, since i would use #include´s to include those external files anyways, is there a simple way to merge a .ino + multiple .h files into a single "block" of code automagically?
Im thinking something that finds those #include "xx" in the main project .ino, and replaces them with the content of their respective header file, resulting in a single .txt document containing all the code from all the external files mentioned.
I doubt that i can use the .hex build output in the online emulator, but are there any pre-existing applescripts or shell-scripts that could do this search-and-dynamic_replace for me?
i tried searching for it, but the results are pretty meager with such vague descriptions, nothing of practical use for a newbie..
So any hints or suggestions would be greatly appreciated! :)