 #define BOUNCE_DELAY 250
 volatile unsigned long last_toogle_time = 0;
 
+// pour lecture commande sur port série
+char cmd [2];
+bool cmd_end = false;
+
 // pour gestion delai entre 2 acqusitions
-#define SENSE_INTERVAL 10000
-unsigned long previous_time = 0;
+#define TEMP_INTERVAL 10000
+#define POT_INTERVAL  3000
+#define YELLOW_INTERVAL 1000
+
+unsigned long prev_temp_time = 0;
+unsigned long prev_pot_time = 0;
+unsigned long prev_yellow_time = 0;
 unsigned long current_time = 0;
 
 // variables utilisées dans setup et/ou loop

  return (pot_value);
}

void setup() {
  // lancement port série
  Serial.begin (9600);


void loop() {
  current_time = millis ();
  
  if (cmd_end == true) {
    switch cmd[0] {
      case 'R':
        if (isDigit (cmd[1]) {
          // inversion LED rouge
          unsigned byte state = atoi(cmd[1];
          if ((state == LOW) || (state == HIGH)) {
            red_state = state;
            digitalWrite (red_led, red_state);
          }
        }
        break;
      case 'B':
        if (isDigit (cmd[1]) {
          // inversion LED bleue
          unsigned byte state = atoi(cmd[1];
          if ((state == LOW) || (state == HIGH)) {
            blue_state = state;
            digitalWrite (blue_led, blue_state);
          }
        }
        break;
      default:
        break;
    }
    cmd_end = false;
  }
  
  if (current_time - prev_temp_time >= TEMP_INTERVAL) {
    prev_temp_time = current_time;
    
    // lecture capteur temperature (2 fois pour pb impédance ?)
    analogRead (temp_pin);
