anyway.. my goal is to control these servos using an external class written in C because I feel more confortable with OOP
the problem is: how the external class can access global variables or functions declared in the main sketch?
my only experience in programming is Processing and AS3, I know is possible using these tools. I guess is the same in arduino
the problem is: how the external class can access global variables or functions declared in the main sketch?
you need to pass them as parameter to the class so the class has a reference. Best known example might be the compare function as param in quicksort() See - qsort() sample program in C++ -
I'm not sure I've understand what you mean. I had a look on the link, I'm pretty don't understand completely the code. Maybe I have to study a little more :
Anyway since an object's function is always called inside the loop, I can pass these variables through this function, yes this could be a solution but. I wondering if there is a way to access these variables (or functions); directly
There are several tenets of OOP. One of them is encapsulation. A class should know only what it is told. Accessing directly, and yes, it could be done, global non-class data would violate this tenet.