Help with my arduino uno program

I can't find where is me error with this program. It is a small circuit made with an arduino uno+ hc05 bluetooth+ adafruit l293d shield + 4 dc motors

#include <AFMotor.h>
AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
AF_DCMotor motor3(3);
AF_DCMotor motor4(4);

char val ='0';
int motorSpeed = 0;

void setup() 
{
Serial.begin(9600); 
}

void loop() 
{
if( Serial.available())
{
  val = Serial.read();
} 
switch (val) 
{  
case '1':
motor1.setSpeed(80);
motor2.setSpeed(80);
motor3.setSpeed(80);
motor4.setSpeed(80);
break;
case '2':
motor1.setSpeed(160);
motor2.setSpeed(160);
motor3.setSpeed(160);
motor4.setSpeed(160);
break;
case '3':
motor1.setSpeed(240);
motor2.setSpeed(240);
motor3.setSpeed(240);
motor4.setSpeed(240);
break;
case 'q':
motor1.run(FORWARD);
motor3.run(FORWARD);
break;
case 'w':
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
break;
case 'e':
motor2.run(FORWARD);
motor4.run(FORWARD);
break;
case 'a':
motor1.run(FORWARD);
motor2.run(BACKWARD);
motor3.run(FORWARD);
motor4.run(BACKWARD);
break;
case 'd':
motor1.run(BACKWARD);
motor2.run(FORWARD);
motor3.run(BACKWARD);
motor4.run(FORWARD);
break;
case 'Z':
motor2.run(BACKWARD);
motor4.run(BACKWARD);
break;
case 'x':
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
break;
case 'c':
motor1.run(BACKWARD);
motor3.run(BACKWARD);
break;
case 'r':
motor1.run(FORWARD);
motor2.run(BACKWARD);
motor3.run(BACKWARD);
motor4.run(FORWARD);
break;
case 'f':
motor1.run(BACKWARD);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(BACKWARD);
break;
}
}

I can connect with the hc05, but no matter which button I choose the motors don't move

here is the app inventor blocks in case you need it (the slider is from 1-3):

app.png

Have you tried printing val ?

The libraries normally come with examples - did they work?

Please remember to use code tags when posting code.

UKHeliBob:
Have you tried printing val ?

yes, it works just normal. it changes as I press the buttons.

AWOL:
The libraries normally come with examples - did they work?

Please remember to use code tags when posting code.

the examples did work for me but it was with the adruino connected and with set variables.