Greetings,
I am an OOP beginner and have the following question:
I have my own class and want to use another class (movingAvgFloat.h) to calculate a moving average.
(GitHub - ThingEngineer/movingAvgFloat: A simple Arduino library for calculating floating point moving averages.)
I already found out that you can't just declare the movingAvgFloat on top, but have to load it with constructors list, because the class is loaded with a parameter.
That works so far. Now I want to use a second object (Avg2) of the movingAvgFloat class, which I can't manage.
My code:[CODE]
What is the syntax for using two objects, something like: ?Code:#include <movingAvgFloat.h> class myClass { private: movingAvgFloat Avg1; public: myClass() : Avg1(6) {}; // Avg with 6 cells ...
Thx a lotCode:private: movingAvgFloat Avg1; movingAvgFloat Avg2; public: myClass() : Avg1(6) {}, Avg2(6) {} // does not work;)
michael