Pan and Tilt Coding of "class ServoLoop"?
I was wondering why the PanTilt sketch provided for the Pixy camera are declared as "class ServoLoop"? Couldn't the code be written as a function (ie:
void ServoLoop(int32_t pgain, int32_t dgain)
void ServoLoopupdate(int32_t error)
Just wondering why it was written as a class and not a function. Thx, Scott
You don't need to use a class or struct. The class or struct allows you to store the gains and the state without having to pass around. It's a programming preference.