The "_think()" functions is called from a few interruptions. I used the attachInterrupt() function for this, and as a result I can't add the _think() function to the library class.
imagine you had 10 instances of your robotOnLine class.. how do you think the ISR would know which _LS2 amongst the 10 to use ?
if _LS2 is unique and shared amongst all the instances (a class variable) then define it static in the class and allocate it outside the class. it has to be volatile too to be handled correctly
it would have to be declared extern for other modules to use it probably
"extern" is for objects, not functions. If you already have a function defined in a header, the rest of your code should be able to use it (provided there's no namespace issues and you have the header included wherever you want to use that function).
F1_:
Many thanks RayLivingston!
That solved the problem.
So _think() has a scope for itself I guess? Because it is an ISR?
_think, like anything else, has a scope that is determined by the scope in which it is defined. The "robotOnLine::_LS2" syntax indicates _LS2 is a public, static member of the robotOnLine class. :: is the c++ "scope resolution" operator. Google it.