Setti inn allar skrár frá Project 3 og bætti við overlay í samræmi við controlloerinn og pin out.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#include "p_controller.h"
|
||||
|
||||
P_controller::P_controller(double Kp)
|
||||
: Kp(Kp)
|
||||
{
|
||||
}
|
||||
|
||||
double P_controller::update(double ref, double actual)
|
||||
{
|
||||
double error = ref - actual;
|
||||
|
||||
return Kp * error;
|
||||
}
|
||||
Reference in New Issue
Block a user