I'm new to the Arduino Way in particular, and also C in general, but have done a fair bit of other programming before. My usual way is to split my code into various modules, classes and/or files, depending on the language etc.
I don't know if I'm falling foul of the C syntax for these things, or limitations of the Arduino build process, but I'm stumped at how to split my code into different classes without creating actual libraries.
For starters, I assume I have to have a directory to match the pde file name
Can I create a bunch of something.h and something.cpp files in that directory and include them? Or in a subdir?
Currently I'm fudging it by creating a subfolder "libraries" and putting them in there, again in a subfolder, and telling the Arduino IDE that my actual root is the current project.
**C:\Projects\ProjectA**ProjectA.pde **C:\Projects\ProjectA\libraries\LibA**LibA.h **C:\Projects\ProjectA\libraries\LibA**LibA.cpp **C:\Projects\ProjectA\libraries\LibB**LibB.h **C:\Projects\ProjectA\libraries\LibB**LibB.cpp
And then in my ProjectA.pde I can do this:
#include "LibA.h" #include "LibB.h" LibA something(); LibB somethingElse()
(My full real example is available here)