 
 // RX
 int throttle = THROTTLE_RMIN;
-volatile int input[5];
-volatile unsigned long chrono_start0, chrono_start1, chrono_start2, chrono_start3,chrono_start4;
+volatile int input[4], arm;
+volatile unsigned long chrono_start0, chrono_start1, chrono_start2, chrono_start3, chrono_start4;
 volatile int last_interrupt_time0, last_interrupt_time1, last_interrupt_time2, last_interrupt_time3, last_interrupt_time4;
 
 // IMU

  motorFL = throttle + pid_pitch_out - pid_roll_out + pid_yaw_out;
  motorBL = throttle - pid_pitch_out - pid_roll_out - pid_yaw_out;
  motorBR = throttle - pid_pitch_out + pid_roll_out + pid_yaw_out;
  
  if(input[4] > 1500){
    esc_1.writeMicroseconds(motorFR);
    esc_2.writeMicroseconds(motorFL);
    esc_3.writeMicroseconds(motorBL);
    esc_4.writeMicroseconds(motorBR);
  }
  if (input[4] < 1500) {
    esc_1.writeMicroseconds(1000);
    esc_3.writeMicroseconds(1000);
    esc_2.writeMicroseconds(1000);
    esc_4.writeMicroseconds(1000);
  }
}

// Fonction qui empeche les moteurs de tourner


// Fonction qui s'execute a chaque cycle
void loop() {
  arm = pulseIn(A4, HIGH);
  bno_get_values();
  
  if (arm > 1500) {
    control_update();
  }
  else {
    motors_set_to_zero();
  }
}
