Help with robot control using motor with encoder

Hi!

I am trying to use a pololu TB67H420FTG to drive a 12v motor with encoder however nothing is happening when I run the arduino sketch. I am following a tutorial and I am not sure if my problem is in the software or the hardware, so code and pictures are attached. Any help would be amazing.

Code:

#define ENCA 2 // Yellow
#define ENCB 3 // White
#define PWM 5
#define IN2 6
#define IN1 7 

int pos = 0;
 
void setup() {
  Serial.begin(9600);
  pinMode(ENCA, INPUT);
  pinMode(ENCB, INPUT);
  attachInterrupt(digitalPinToInterrupt(ENCA),readEncoder,RISING);
}

void loop() {
  setMotor(1,25,PWM,IN1,IN2);
  delay(200);
  Serial.println(pos);
  setMotor(-1,25,PWM,IN1,IN2);
  delay(200);
  Serial.println(pos);
  setMotor(0,25,PWM,IN1,IN2);
  delay(200);
  Serial.println(pos);

}

void setMotor(int dir, int pwmVal, int pwm, int in1, int in2){
  analogWrite(pwm,pwmVal);
  if(dir == 1){
    digitalWrite(in1, HIGH);
    digitalWrite(in2, LOW);
  }
  else if(dir == -1){
    digitalWrite(in1, LOW);
    digitalWrite(in2, HIGH);
  }
  else {
    digitalWrite(in1, LOW);
    digitalWrite(in2, LOW);
  }
}
void readEncoder(){
  int b = digitalRead(ENCB);
  if(b>0){
    pos++;
  }
  else{
    pos--;
  }
}

Hardware + Wiring:




It looks like the long side of the header pins on your driver are stuck through the driver board. This will not make a good connection with the breadboard. This instructable on soldering headers shows the correct way.

If it is still not working after you get the headers soldered properly, please post pictures of the soldering and try testing your motor directly with your motor supply.

-Claire