 {
   readSensors();
   printSensors();
-  sensorVals[s] = 20;
-  drive(sensorVals[n], sensorVals[s], sensorVals[e], sensorVals[w]);
+  //sensorVals[s] = 300;
+  determineDirection();
+  //drive(sensorVals[n], sensorVals[s], sensorVals[e], sensorVals[w]);
   
   BT.println();
   BT.println();

  //determineDirection();
  //drive(sensorVals[n], sensorVals[s], sensorVals[e], sensorVals[w]);
  //lcd.println();
  delay(1500);
}



  //check to see which direction has highest value
  //check to see which direction is second
  //check to see which direction is third
  if(sensorVals[n] > 80 || sensorVals[w] > 80 || sensorVals[e] > 80)
  {
  if ((sensorVals[n]*.7) > sensorVals[w] || (sensorVals[n]*.7) > sensorVals[e])
  {
    if (abs(sensorVals[w]-sensorVals[e]) < 50)
    {
      analogWrite(l1_motor, 200);
      analogWrite(l2_motor, 0);
      analogWrite(r1_motor, 200);
      analogWrite(r2_motor, 0);
      //lcd.println("head north");
      Serial.println("head north");
      BT.println("head north");
    }
    else if (sensorVals[w]*1.2 >= sensorVals[e]*1.2)
    {
      analogWrite(l1_motor, 50);
      analogWrite(l2_motor, 0);
      analogWrite(r1_motor, 200);
      analogWrite(r2_motor, 0);
      //lcd.println("head north-west");
      Serial.println("head north-west");
      BT.println("head north-west");
    }
    else if (sensorVals[e]*1.2 >= sensorVals[w]*1.2)
    {
      analogWrite(l1_motor, 200);
      analogWrite(l2_motor, 0);
      analogWrite(r1_motor, 50);
      analogWrite(r2_motor, 0);
      //lcd.println("head north-east");
      Serial.println("head north-east");
      BT.println("head north-east");
    }
    else
    {
      //lcd.println("no direction or continue moving along last direction");
      Serial.println("no direction or continue moving along last direction");
      BT.println("no direction or continue moving along last direction");
      //some error
    }
  }
  //else if ((sensorVals[e]*.6) > sensorVals[n] && (sensorVals[e]*.6) > sensorVals[s])
  else if ((sensorVals[e]*.65) > sensorVals[n] && sensorVals[e]*.9 > sensorVals[w])
  //else if ((sensorVals[e]*.65) > sensorVals[n] && sensorVals[e] > 100)
  {
      analogWrite(l1_motor, 200);
      analogWrite(l2_motor, 0);
      analogWrite(r1_motor, 0);
      analogWrite(r2_motor, 200);
    Serial.println("head east");
    BT.println("head east");
//    if (abs(sensorVals[n]-sensorVals[s]) < 50)
//    {
//      //lcd.println("head east");
//      Serial.println("head east");
//      BT.println("head east");
//    }
//    else if (sensorVals[n]*1.2 >= sensorVals[s]*1.2)
//    {
//      //lcd.println("head east-north-east");
//      Serial.println("head east-north-east");
//      BT.println("head east-north-east");
//    }
//    else if (sensorVals[s]*1.2 >= sensorVals[n]*1.2)
//    {
//      //lcd.println("head east-south-east");
//      Serial.println("head east-south-east");
//      BT.println("head east-south-east");
//    }
//    else
//    {
//      //lcd.println("no direction or continue moving along last direction");
//      Serial.println("no direction or continue moving along last direction");
//      BT.println("no direction or continue moving along last direction");
//      //some error
//    }
  }
  //else if ((sensorVals[w]*.6) > sensorVals[n] && (sensorVals[w]*.6) > sensorVals[s])
  else if ((sensorVals[w]*.65) > sensorVals[n] && sensorVals[w]*.9 > sensorVals[e])
  //else if ((sensorVals[w]*.65) > sensorVals[n]  && sensorVals[w > 100)
  {
      analogWrite(l1_motor, 0);
      analogWrite(l2_motor, 200);
      analogWrite(r1_motor, 200);
      analogWrite(r2_motor, 0);
     Serial.println("head west");
     BT.println("head west");
//    if (abs(sensorVals[n]-sensorVals[s]) < 50)
//    {
//     // lcd.println("head west");
//     Serial.println("head west");
//     BT.println("head west");
//    }
//    else if (sensorVals[n]*1.2 >= sensorVals[s]*1.2)
//    {
//      //lcd.println("head west-north-west");
//      Serial.println("head west-north-west");
//      BT.println("head west-north-west");
//    }
//    else if (sensorVals[s]*1.2 >= sensorVals[n]*1.2)
//    {
//      //lcd.println("head west-south-west");
//      Serial.println("head west-south-west");
//      BT.println("head west-south-west");
//    }
//    else
//    {
//      //lcd.println("no direction or continue moving along last direction");
//      Serial.println("no direction or continue moving along last direction");
//      BT.println("no direction or continue moving along last direction");
//      //some error
//    }
  }
//  else if ((sensorVals[s]*.6) > sensorVals[w] && (sensorVals[s]*.6) > sensorVals[e])
//  {
//    if (abs(sensorVals[w]-sensorVals[e]) < 50)
//    {
//      //lcd.println("head south");
//    }
//    else if (sensorVals[w]*1.2 >= sensorVals[e]*1.2)
//    {
//      //lcd.println("head south-west");
//    }
//    else if (sensorVals[e]*1.2 >= sensorVals[w]*1.2)
//    {
//      //lcd.println("head south-east");
//    }
//    else
//    {
//      //lcd.println("no direction or continue moving along last direction");
//      //some error
//    }
//  }
  else
  {
    //lcd.println("got no where");
    Serial.println("got no where");
    BT.println("got no where");
  }
  }
  else
  {
      analogWrite(l1_motor, 0);
      analogWrite(l2_motor, 0);
      analogWrite(r1_motor, 0);
      analogWrite(r2_motor, 0);
     Serial.println("no signal");
     BT.println("no signal");
    
  }
}

