I am trying to use Arduino's PID library in a class I made. Does this look it would work? Every time I look this up, they say to extend and use a virtual class, but that seems more complex than it needs to be.
Would this not work?
Would this not work?
Code:
class Control{
private:
//private variables
public:
Control()
{
double Setpoint, Input, Output;
PID myPID(&Input, &Output, &Setpoint,2,5,1, DIRECT);
}
//rest of my public functions to access private variables
};