     bitClear(flags, F_FIRST_CYCLE);
     // Clear the ping buffers.
     pingBufferLeft.zero();
+    pingBufferRight.zero();
     return;
   }
   /*

  int current = pingBufferLeft.current();
  if (current == 0) {
    if (pingBufferLeft.previous(0) > 0 && pingBufferLeft.previous(1) > 0) {
      Serial.print(pingBufferLeft.currentIndex()); Serial.print(" : ");
  Serial.print(pingBufferLeft.peek(0)); Serial.print(" : ");
  Serial.print(pingBufferLeft.peek(1)); Serial.print(" : ");
  Serial.print(pingBufferLeft.peek(2)); 
  Serial.println();
      
      Serial.println("LEFT FELL");
      
      
      
    }
  }
  
  /*
  int bi = pingBufferLeft.currentIndex();
  int count = pingBufferLeft.count();
  // previous reading
  bi--;
  if (bi < 0) bi = count -1;
  */
  
  
  /*
  // Check for activation.
  if (cm[0] > 0 && cm[0] < DISTANCE_THRESHOLD) {
    // Flag that it happend.
    bitSet(flags, F_LEFT);
  } else {
    bitClear(flags, F_LEFT);
  }
  if (cm[1] > 0 && cm[1] < DISTANCE_THRESHOLD) {
    // Flag that it happend.
    bitSet(flags, F_RIGHT);
  } else {
    bitClear(flags, F_RIGHT); 
  }
  
  handlePingFlags();
  */
}

void handlePingFlags()
{
  unsigned long now = millis();
  if (now - lastDirectionDetected > DIRECTION_DEBOUNCE_TIME) {
  
    Serial.print(flags, BIN); Serial.print(" - ");
    
    if (bitRead(flags, F_ACTIVE_RIGHT)) {
      // Waiting for left.
      if (bitRead(flags, F_LEFT)) {
        
        bitClear(flags, F_ACTIVE_LEFT);
        bitClear(flags, F_ACTIVE_RIGHT);
        bitClear(flags, F_RIGHT); 
        bitClear(flags, F_LEFT); 
        // Need to ignore for while to debounce ...
        lastDirectionDetected = now;
        createTransmitionMsg('L');
      }
    } else if (bitRead(flags, F_ACTIVE_LEFT)) {
      // Waiting for right.
      if (bitRead(flags, F_RIGHT)) {
        
        bitClear(flags, F_ACTIVE_LEFT);
        bitClear(flags, F_ACTIVE_RIGHT);
        bitClear(flags, F_RIGHT); 
        bitClear(flags, F_LEFT);
        // Need to ignore for while to debounce ...
        lastDirectionDetected = now;
        createTransmitionMsg('R');
      }
    } else if (bitRead(flags, F_RIGHT)) {
      bitSet(flags, F_ACTIVE_RIGHT);
      bitClear(flags, F_RIGHT);
    } else if (bitRead(flags, F_LEFT)) {
      bitSet(flags, F_ACTIVE_LEFT);
      bitClear(flags, F_LEFT);
    }
    
    Serial.println(flags, BIN);
  }
  
  /*
  if (!bitRead(flags, F_LEFT) && !bitRead(flags, F_RIGHT)) {
    // Waiting for activation.
    return;
    
  } else if (bitRead(flags, F_LEFT) && bitRead(flags, F_RIGHT)) {
    
    // Both beams are broken
    return;
    
  } else 
  */
  /*
  if (bitRead(flags, F_LEFT)) {
    
    // Left beam is broken only
    if (bitRead(flags, F_ACTIVE_RIGHT)) {
      // Right beam was activate first.
      bitClear(flags, F_ACTIVE_RIGHT);
      
      // Send left < right message
      createTransmitionMsg('L');
      
    } else {
      // Start of activation.
      bitSet(flags, F_ACTIVE_LEFT);
    }
  
  } else if (bitRead(flags, F_RIGHT)) {
    
    // Right beam is broken only
    if (bitRead(flags, F_ACTIVE_LEFT)) {
      // Left beam was activate first.
      bitClear(flags, F_ACTIVE_LEFT);
      
      // Send left > right message
      createTransmitionMsg('R');
      
    } else {
      // Start of activation.
      bitSet(flags, F_ACTIVE_RIGHT);
    }
    
  }
  */

}

/*

  
  pinMode(PIN_DEBUG_MOTION, OUTPUT);
  
  
  vw_set_tx_pin(PIN_RF_TX);
  vw_setup(2000);      // Bits per sec
