PaulS:
Every class should have a constructor, even if the constructor does nothing. randomAnimation does not, so the compiler generates one for you that does who knows what. Don't let that happen.How does the base class, animation, learn of the existence of the utilities instance?
It would be a lot simpler if all the methods in the utilities class were static.
I made a mistake writing this simplified example:
the line 'C(int wait, RGB24B color) {}' should be 'randomAnimation(int wait, RGB24B color) {}'
Exactly that is my question, I would change the constructor of the base class 'animation' to:
animation(utilities &leds) : utils(leds){} //leds is the utilities instance
to initialize the reference but because this is the base class constructor would it not be called or am I wrong?
Making all methods/members of the class 'utilities' static is possible but how would this help? There will be only one instance of this class.