I'm trying to break up a larger project into multiple files. From what I read I understand that I HAVE to create libraries for this. Am I right about that?
In Processing I'm used to just adding a tab and creating a class, but that doesn't seem to work in Arduino? A new tab creates a new pde file by default but for Arduino that seems useless since it won't import that classes from the tabs into my main project it seems.
I have tried to create a library using h and cpp files. Now the problem seems to be that my library doesn't compile because it depends on other libraries. I don't know how to solve this.
For testing I created an empty project which uses MyClass. MyClass uses Messenger. My sketch then includes the
First I created MyClass.h and MyClass.cpp and placed them next to my sketch. My sketch includes the MyClass.h file.
With this approach I get the error: 23: error: Messenger.h: No such file or director
Apparently the code is trying to compile but the include path is not set the same way as my main sketch?
Then I try to put the 2 MyClass files in a folder with the same name inside the hardware/libraries/ folder. When I do this, and try to compile I get:
/Applications/Arduino.app/Contents/Resources/Java/hardware/libraries/MyClass/MyClass.cpp:9: error: 'Messenger' was not declared in this scope
What's up with that? How am I supposed to create my own classes that depend on other libraries? Is this not possible? I'm confused.
I'd rather not create a library at all. All I want to do is break up my main sketch into multiple files....