public void calibrate()
  {
    Delay.msDelay(200);
    System.out.println("Calibrate ");
    File data = new File("Track.dat");
    LCD.clear();
    if (!data.exists())
    {
      for (byte i = 0; i < 3; i++)
      {
        Delay.msDelay(200);
        LCD.drawInt(i, 0,0);
        while(0 == Button.readButtons())
        {  // show light values till button is hit
          LCD.drawInt(leftEye.getLightValue(), 4, 6, 2 + i);
          LCD.drawInt(rightEye.getLightValue(), 4, 10, 2 + i);
          if (i == 0)
          {
            LCD.drawString("LOW", 0, 2 + i);
          } else if (i == 1)
          {
            LCD.drawString("HIGH", 0, 2 + i);
          } else
          {
            LCD.drawString("BLACK", 0, 2 + i);
          }
        }
        Sound.playTone(1000 + 200 * i, 100);
//        while(Button.readButtons()>0);
        if (i == 0)
        {
          leftEye.calibrateLow();
          rightEye.calibrateLow();
        } else if (i == 1)
        {
          rightEye.calibrateHigh();
          leftEye.calibrateHigh();
        } else
        {
          _marker = leftEye.getLightValue() / 2;
        }
        Delay.msDelay(200);
        try
        {
           data.createNewFile();
          DataOutputStream dos = new DataOutputStream(new FileOutputStream(data));
          dos.writeInt(leftEye.getLow());
          dos.writeInt(rightEye.getLow());
          dos.writeInt(leftEye.getHigh());
          dos.writeInt(rightEye.getHigh());
          dos.writeInt(_marker);
          dos.flush();
          dos.close();
        } catch (IOException ioe)
        {
        }
      }
      System.out.println("Data written");
      Button.waitForAnyPress();
    } else
    {
      try
      {
        DataInputStream dis = new DataInputStream(new FileInputStream(data));
        leftEye.setLow(dis.readInt());
        rightEye.setLow(dis.readInt());
        leftEye.setHigh(dis.readInt());
        rightEye.setHigh(dis.readInt());
        _marker = dis.readInt();
      } catch (IOException ioe)
      {
      }

    }
    
    LCD.clear();
    System.out.println(" Calibration Done");
    Delay.msDelay(200);
    
    while (0 == Button.readButtons())// while no press
    {
      int lval = leftEye.getLightValue();
      int rval = rightEye.getLightValue();
      
      LCD.drawInt(lval, 4, 0, 4);
      LCD.drawInt(rval, 4, 4, 4);
      LCD.drawInt(CLDistance(lval, rval), 4, 8, 4);
      LCD.refresh();

    }
    LCD.clear();
  }