mirror of
https://github.com/brendanhaines/RasPi.git
synced 2024-11-09 16:44:40 -07:00
23 lines
304 B
C++
23 lines
304 B
C++
/*
|
|
* pid.h
|
|
*/
|
|
|
|
#ifndef PID_H
|
|
#define PID_H
|
|
|
|
#include <ctime>
|
|
|
|
class PID
|
|
{
|
|
public:
|
|
PID( double p = 0, double i = 0, double d = 0 );
|
|
|
|
double update( double current, double desired );
|
|
private:
|
|
double pGain, iGain, dGain;
|
|
|
|
clock_t lastUpdate;
|
|
double integral, lastPosition;
|
|
};
|
|
|
|
#endif |