Speed control of DC motor with arduino

If the code I gave you in post #19 worked, then try this code.
It slowly increases the speed from 0 to maximum in about 30 seconds.
If the speed does not vary, then the speed of your pump is not variable with PWM.

// PINOUT
// L_EN -> 8
// R_EN -> 8
// L_PWM -> 9
// R_PWM -> 10
 

const uint8_t EN = 8;
const uint8_t L_PWM = 9;
const uint8_t R_PWM = 10;


void setup() 
{
  pinMode (EN, OUTPUT);
  pinMode (L_PWM, OUTPUT);
  pinMode (R_PWM, OUTPUT);
  
  digitalWrite (EN, LOW);
  digitalWrite (L_PWM, LOW);
  digitalWrite (R_PWM, LOW);
  delay(1000);
}

void loop() 
{
  digitalWrite (EN, HIGH);
  for (int i=10; i<256; i++)
  {
    analogWrite (L_PWM, i);
    delay (125);
  }
  delay (1000);
  digitalWrite (EN, LOW);
  digitalWrite (L_PWM, LOW);
  digitalWrite (R_PWM, LOW);
}
//