Change direction on dfrobot motor shield l298p

I want to change direction of rotation of motor by df robot motor shield l298p, but it is not works. I read the manual and used code from there. I found same problems (here) but cant found resolve it. How to change direction?

and used code from there.

I can't see any code that would change the direction.
Pin 4 and pin 7 seem to be wired to the arduino to control the direction. Have you done this and defined them as outputs in the setup function?

You need to post the code you are trying along with a diagram of how you have connected things up and where you are getting the power from.
It would also help if you posted a picture (not more than 1000 pixels wide) so we could check that you have it wired like you think.

Oh, sorry. I was distrait. In these code, motor must to rotate forward and backward. But instead of backward rotation i hear only quite noise.

int E2= 6;
int M2= 7;

void setup() {
  pinMode(M2, OUTPUT);
}

void loop()
{
    digitalWrite(M2, HIGH);
    analogWrite(E2, 255);
    delay(2000);
	
    digitalWrite(M2, LOW);
    analogWrite(E2, 255);
    delay(2000);
}