Buck Boost Converter PID controller using Arduino nano

Hello Guys,
I’m trying to creat a PID controller for my inverting Buck boost converter , I’m facing alot of errors wjile programing and I have no idea what to chance ,I need HELP!,I’ve attached my code :

int potentiometer = A0;
int feedback = A1;
int PWM = 3;
int pwm = 0;
int analogPin = 0;

//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
double kp=1, ki=.4, kd=0;
//PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);
PID::PID(double* Input, double* Output, double* Setpoint,double Kp, double Ki, double Kd, int DIRECT)
    
void compute(){
unsigned long previousMillis();  //How long since we last calculated*
 double timeChange = (double)(now - lastTime);
}
void setup() {
  // put your setup code here, to run once:
pinMode(potentiometer, INPUT);
pinMode(feedback, INPUT);
pinMode(PWM, OUTPUT);
 analogWrite(PWM,120);
  //initialize the variables we're linked to
 Input = analogRead(analogPin);//turn the PID on
  myPID.SetMode(AUTOMATIC);
  myPID.SetOutputLimits(0,255);
  }

void loop() {
  // put your main code here, to run repeatedly:
  Input = analogRead(analogPin);    // read the input pin
    myPID.Compute();
    analogWrite(PWM, output);
} 
}

try_4_PID.ino (1.05 KB)

You have an extra } at the end of your code. (Someone else today was missing one over in the Programming forum. Maybe you found the missing one?)

Use the auto-format function. It is very good. If it shows two } in the same column (same spaces to the left) you can be sure you have a problem.

We are going to need to know a lot more about the attached hardware before we can make any guesses on what is wrong.

Speaking of which, what is wrong? You didn't say what it actually does. If we know what you want it to do and we know what it actually does then we can suggest useful things to change.