Question about pulseIn

    if(tright<=1200)  //si se pulsa aprox 1 segundo
     {
       derecha(7);
     }
    
     else if(tright<=3000)  //si se pulsa aprox 2 segundos
     {
       derecha(20);
     }

You need a Serial.print() statement (or two) to show what the value of tright is. If it is less than or equal 1200, the first block will be executed. If it is greater than 1200 and less than or equal to 3000, the second one will. In determining whether the code is behaving correctly, it is important to know what the value in tright is.

    tright=pulseIn(pushright, HIGH); //tiempo que se pulsa

The pulseIn function is not intended to be used for switches pressed by humans. It is for measuring much shorter times than that. The function will actually wait for you to release the switch and press it again. Is that really what you want?

     else
     {
       error;
     }

What is this supposed to be doing? It is not calling a function.