How to increase the speed of a motor with bytes

Hello! I am participating in an robotics contest and I need to increase the speed of the motors for a line-follower. It's programed using bytes which I don't have expirience with and I can't figure out how to increase the speed. Whenever I changed the value of a byte the robot wouldn't move at all.
The code looks like this(Also inceput=begging; inainte=forward; inapoi=backwards; senzorDreapta=sensorRight and senzorStanga=sensorLeft. Sorry but the code is in Romanian):

volatile byte inceput;

volatile byte inainte;

volatile byte inapoi;

volatile int stare;

volatile int senzorStanga;

volatile int senzorDreapta;



void setup(){

  inceput = 254;

  inainte = 240;

  inapoi = 186;

  stare = 0;

  senzorStanga = 0;

  senzorDreapta = 0;

  pinMode(3, INPUT);

  pinMode(9, INPUT);

  Serial.begin(9600);

}



void loop(){

  senzorStanga = digitalRead(3);

  senzorDreapta = digitalRead(9);

  if (senzorStanga == 1) {

    if (senzorDreapta == 1) {

      stare = 0;



    } else {

      stare = 1;



    }



  } else if (senzorDreapta == 1) {

    stare = -1;

  }

  switch (stare) {

   case -1:

    Serial.write(inceput);

    Serial.write(1);

    Serial.write(inainte);

    Serial.write(50);

    Serial.write(inceput);

    Serial.write(2);

    Serial.write(inainte);

    Serial.write(0);

    break;

   case 1:

    Serial.write(inceput);

    Serial.write(1);

    Serial.write(inainte);

    Serial.write(0);

    Serial.write(inceput);

    Serial.write(2);

    Serial.write(inainte);

    Serial.write(50);

    break;

   default:

    Serial.write(inceput);

    Serial.write(1);

    Serial.write(inainte);

    Serial.write(50);

    Serial.write(inceput);

    Serial.write(2);

    Serial.write(inainte);

    Serial.write(50);

    break;

  }



}

Thanks

It's programed using bytes which I don't have expirience with

Why do you believe that bytes are the problem? Do ints work? Is this your own code? Why are the global variables declared with the 'volatile' keyword?

Have you tested the motor hardware with a simple sketch that only exercises the motors, to make sure the motors and motor drives work?

You are sending messages over Serial to something. What is the thing you are sending to? Where is the instruction manual for it?

As a guess, it looks like you’re using a serial message to another Arduino, possibly over an XBee shield, and that Arduino is controlling the motors.

I’m guessing that your command structure is something like:

byte 0; header (always 0xFE)
byte 1: motor ID (1=left, 2=right or 1=right, 2=left)
byte 2: direction (0xF0 == forward, 0xBA == reverse)
byte 3: speed (255d=full, 0d=stop)

If so, it would be byte ‘3’ you want to change; something larger, such as 100:

.
.
.
    switch (stare) 
    {   
        case -1:
            Serial.write(inceput);
            Serial.write(1);
            Serial.write(inainte);
            Serial.write(100);       //<-- changed
            Serial.write(inceput);
            Serial.write(2);
            Serial.write(inainte);
            Serial.write(0);
            
        break;
        
        case 1:
            Serial.write(inceput);      
            Serial.write(1);
            Serial.write(inainte);
            Serial.write(0);            
            Serial.write(inceput);
            Serial.write(2);
            Serial.write(inainte);
            Serial.write(100);        //<-- changed
            
        break;
        
        default:
            Serial.write(inceput);
            Serial.write(1);
            Serial.write(inainte);
            Serial.write(100);        //<-- changed
            Serial.write(inceput);
            Serial.write(2);
            Serial.write(inainte);
            Serial.write(100);        //<-- changed
        break;

    }

.
.
.