         digitalWrite(motor_left_forward, LOW);
         digitalWrite(motor_left_backward, HIGH);
     }
+    //configuring up motor PWM
+    motor_up_pwm = byte(abs(motor_up_speed));  
+    if(motor_up_speed >= 0){
+        digitalWrite(motor_up_forward, HIGH);
+        digitalWrite(motor_up_backward, LOW);
+    }
+    else{
+        digitalWrite(motor_up_forward, LOW);
+        digitalWrite(motor_up_backward, HIGH);
+    }
     Serial.write(motor_right_pwm);
     Serial.write(motor_left_pwm);
+    Serial.write(motor_up_pwm);
     Serial.flush();   
   }
 }

    incomingByte_X= constrain(incomingByte_X, -100,100);
    incomingByte_Y = Serial.read();
    incomingByte_Y= constrain(incomingByte_Y, -100,100);
    //computing new speed for right and left wheels  
//    motor_right_speed = X_factor*float(incomingByte_X) - Y_factor *float(incomingByte_Y)*float(sign(incomingByte_X)) ;
//    motor_right_speed = map(motor_right_speed, -300.0, 300.0,-255.0,255.0);
//    motor_left_speed = X_factor*float(incomingByte_X) + Y_factor *float(incomingByte_Y)*float(sign(incomingByte_X));
//    motor_left_speed = map(motor_left_speed, -300.0, 300.0,-255.0,255.0);
    motor_right_speed = compute_Right_Wheel_Speed(float(incomingByte_X), float(incomingByte_Y));
    motor_left_speed = compute_Left_Wheel_Speed(float(incomingByte_X), float(incomingByte_Y));
    //configuring right motor PWM
    motor_right_pwm = byte(abs(motor_right_speed));
    if(motor_right_speed >= 0){

const int motor_left_backward = 12;
const int motor_left_enable = 11;

const int motor_up_forward = 5;//TODO set the adequate value
const int motor_up_backward = 6;//TODO set the adequate value
const int motor_up_enable = 10;//TODO set the adequate value


byte motor_right_pwm = 0;
byte motor_left_pwm = 0;
byte motor_up_pwm = 0;

float motor_right_speed = 0;
float motor_left_speed = 0;
float motor_up_speed = 0;

char incomingByte_X = 0;
char incomingByte_Y = 0;
char incomingByte_Z = 0;

const float X_factor = 1.0;
const float Y_factor = 1.0;
const float Z_factor = 1.0;

