Arduino

I just want to make a automatic door open and close using (arduino uno,l293d motor shield,12v dcmotor,2-ultrasonic sensor HC-SR04,12v adapter) when one ultrasonic sonic detect motion the dcmotor should move backward and 5seconds delay again motor should move forward,other side of door another ultrasonic sensor detects motion motor should move backward and delay 5seconds and move forward,can anyone suggest me how to do this,I dont know how to write a code.

Start with an hc-sr04 example and understand it.
Next make it switch a led on and off depending on distance.
Next make it switch a led on for a specific time.

If you get stuck, ask.

Next do something similar for the motor driver till you understand how it works.

And in the last step, merge the motor driver part with the sr04 part.

// I just want to make a automatic door open and close using (arduino uno,l293d motor shield,12v dcmotor,2-ultrasonic sensor HC-SR04,12v adapter) 

    // when one ultrasonic sonic detect motion 
    if (HC-SR04GetDistanceCM(Trigger1Pin, Echo1Pin, Timeout1DistanceCM) != 0) 
    { // (Object is closer then timeout distance)
        // the dcmotor should move backward 
        MotorBackward();
        // and 5 seconds delay 
        delay(5000);
        // again motor should move forward, 
        MotorForward();
        delay(5000);
        MotorStop();
    }

    //other side of door another ultrasonic sensor detects motion 
    if (HC-SR04GetDistanceCM(Trigger2Pin, Echo2Pin, Timeout2DistanceCM) != 0) 
    { // (Object is closer then timeout distance)
        // motor should move backward 
        MotorBackward();
        // and delay 5 seconds 
        delay(5000);
        // and move forward, 
        MotorForward();
        delay(5000);
        MotorStop();
    }